Skip to content

Commit 21172bc

Browse files
committed
GPU Metal: pass the no-fast-math flags as separate arguments
GPUCA_METAL_NO_FAST_MATH_FLAGS is a string of two flags, appended to METAL_FLAGS as one list element, so the Metal compiler got the single argument '-fno-fast-math -ffp-contract=off' and rejected it: with GPUCA_DETERMINISTIC_MODE set to NO_FAST_MATH or OPTO2 the Metal kernels did not build. Split the string first.
1 parent c5d51ba commit 21172bc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎GPU/GPUTracking/Base/metal/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ set(METAL_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionMetalCode)
2828
# relies on for GPUgeneric() and GPUdDefault().
2929
set(METAL_FLAGS -std=metal4.1 ${GPUCA_METAL_DENORMALS_FLAGS})
3030
if(GPUCA_DETERMINISTIC_MODE GREATER_EQUAL ${GPUCA_DETERMINISTIC_MODE_MAP_NO_FAST_MATH})
31-
set(METAL_FLAGS ${METAL_FLAGS} ${GPUCA_METAL_NO_FAST_MATH_FLAGS})
31+
# A string of several flags, which the custom commands below would pass as one
32+
separate_arguments(GPUCA_METAL_NO_FAST_MATH_FLAGS_LIST UNIX_COMMAND "${GPUCA_METAL_NO_FAST_MATH_FLAGS}")
33+
set(METAL_FLAGS ${METAL_FLAGS} ${GPUCA_METAL_NO_FAST_MATH_FLAGS_LIST})
3234
endif()
3335
set(METAL_DEFINES "-D$<JOIN:$<TARGET_PROPERTY:O2::GPUTracking,COMPILE_DEFINITIONS>,$<SEMICOLON>-D>"
3436
"-I$<JOIN:$<FILTER:$<TARGET_PROPERTY:O2::GPUTracking,INCLUDE_DIRECTORIES>,EXCLUDE,^/usr/include/?>,$<SEMICOLON>-I>"

0 commit comments

Comments
 (0)