From 0c1d2900908f966a6066b2ef2040841220b2909f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 18 Oct 2024 10:00:07 -0400 Subject: [PATCH] Tests: Ensure CUDA bin2c output is null terminated The default behavior of bin2c is to create binary arrays that have no null termination. So to use it as a C array we need to explicitly tell it to create valid null terminated strings. This will safely allow us to run PTX tests across all CUDA drivers. --- Tests/CudaOnly/utils/bin2c_wrapper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CudaOnly/utils/bin2c_wrapper.cmake b/Tests/CudaOnly/utils/bin2c_wrapper.cmake index 0baf93434d..d598eda9fb 100644 --- a/Tests/CudaOnly/utils/bin2c_wrapper.cmake +++ b/Tests/CudaOnly/utils/bin2c_wrapper.cmake @@ -6,7 +6,7 @@ foreach(obj ${OBJECTS}) get_filename_component(obj_dir ${obj} DIRECTORY) if(obj_ext MATCHES ".ptx") - set(args --name ${obj_name} ${obj}) + set(args -p 0x0 --name ${obj_name} ${obj}) execute_process(COMMAND "${BIN_TO_C_COMMAND}" ${args} WORKING_DIRECTORY ${obj_dir} RESULT_VARIABLE result