Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4849cda
GPU: Apple Metal backend, off by default
ktf Sep 25, 2026
4f7beb0
GPU: give Metal its own definitions of the double math helpers
ktf Sep 25, 2026
2d85bbd
GPU: give Metal a column in the tuning parameter table
ktf Sep 25, 2026
b645c0b
GPU: give Metal its own spellings for three math helpers
ktf Sep 25, 2026
9a36019
GPU: extend two existing OpenCL device workarounds to Metal
ktf Sep 25, 2026
75b4170
GPU: make the kernel entry-point signature work on Metal
ktf Sep 25, 2026
0c0a01a
GPU: number the kernel arguments so Metal can bind them
ktf Sep 25, 2026
9f296a3
GPU: give Metal an IEEE-754 binary64 in software
ktf Sep 25, 2026
bf75199
GPU: give Metal an entry in the no-fast-math table
ktf Sep 25, 2026
219acc9
GPU: take the work-item indices from the kernel parameters
ktf Sep 25, 2026
00909d6
MathUtils: extend the OpenCL sincos workaround to Metal
ktf Sep 25, 2026
68ca26c
GPU: reach global memory through the generic address space on Metal
ktf Sep 25, 2026
ab2f083
GPU: make the Metal atomics operate on plain counters
ktf Sep 25, 2026
1b3f1da
GPUTracking: declare the resolve kernel's shared memory as shared
ktf Sep 25, 2026
c8ce55e
GPUTracking: rename the cluster finder's fragment to frag
ktf Sep 25, 2026
7d75d71
GPU: let the constant-address-space constants be built on Metal
ktf Sep 25, 2026
f97c908
GPU: make std::is_pointer address-space aware on Metal
ktf Sep 25, 2026
f7d0bbc
GPUTracking: replace the merger's goto with a flag
ktf Sep 25, 2026
ba3e057
MathUtils: let bringTo* deduce the type of the call they forward to
ktf Sep 25, 2026
935e863
ReconstructionDataFormats: use the MatrixD5 alias in the Kalman gain …
ktf Sep 25, 2026
926fc42
GPU: hand the kernel pointers to Thread() as generic pointers
ktf Sep 25, 2026
2743450
MathUtils: make getMean()'s ternary unambiguous for an emulated double
ktf Sep 25, 2026
743edc9
MathUtils: declare fastATan2's Pi where its lambdas can use it
ktf Sep 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GPU: give Metal an entry in the no-fast-math table
The other backends switch their fast math flags off once
GPUCA_DETERMINISTIC_MODE reaches GPUCA_DETERMINISTIC_MODE_MAP_NO_FAST_MATH.
Metal had no entry there, so it kept whatever the default build type gave it.

It has one now. Deterministic mode is still rejected on Metal, because the
emulated double's sin and cos are not bit-identical to libm, but the flag plumbing
should not be the reason.
  • Loading branch information
ktf committed Sep 25, 2026
commit bf7519912fbeb139cb1dde2ed22cee9caf4350e9
3 changes: 3 additions & 0 deletions GPU/GPUTracking/Base/metal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ set(METAL_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionMetalCode)
# reject an unannotated pointer or `this` outright, which GPUCommonDefAPI.h
# relies on for GPUgeneric() and GPUdDefault().
set(METAL_FLAGS -std=metal4.1 ${GPUCA_METAL_DENORMALS_FLAGS})
if(GPUCA_DETERMINISTIC_MODE GREATER_EQUAL ${GPUCA_DETERMINISTIC_MODE_MAP_NO_FAST_MATH})
set(METAL_FLAGS ${METAL_FLAGS} ${GPUCA_METAL_NO_FAST_MATH_FLAGS})
endif()
set(METAL_DEFINES "-D$<JOIN:$<TARGET_PROPERTY:O2::GPUTracking,COMPILE_DEFINITIONS>,$<SEMICOLON>-D>"
"-I$<JOIN:$<FILTER:$<TARGET_PROPERTY:O2::GPUTracking,INCLUDE_DIRECTORIES>,EXCLUDE,^/usr/include/?>,$<SEMICOLON>-I>"
-I${CMAKE_SOURCE_DIR}/Detectors/TRD/base/src
Expand Down
1 change: 1 addition & 0 deletions dependencies/FindO2GPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ endif()
set(GPUCA_CXX_NO_FAST_MATH_FLAGS "-fno-fast-math -ffp-contract=off")
set(GPUCA_CUDA_NO_FAST_MATH_FLAGS "--prec-div=true --prec-sqrt=true --fmad false -Xcompiler -fno-fast-math -Xcompiler -ffp-contract=off")
set(GPUCA_OCL_NO_FAST_MATH_FLAGS -cl-fp32-correctly-rounded-divide-sqrt )
set(GPUCA_METAL_NO_FAST_MATH_FLAGS "-fno-fast-math")
if(GPUCA_DETERMINISTIC_MODE GREATER_EQUAL ${GPUCA_DETERMINISTIC_MODE_MAP_WHOLEO2})
add_definitions(-DGPUCA_DETERMINISTIC_MODE)
string(APPEND CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER} " ${GPUCA_CXX_NO_FAST_MATH_FLAGS}")
Expand Down