Skip to content

GPU: Metal branches in the common definition macros - #15772

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr15772
Open

GPU: Metal branches in the common definition macros#15772
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr15772

Conversation

@ktf

@ktf ktf commented Sep 6, 2026

Copy link
Copy Markdown
Member

Defines the GPUd()/GPUshared()/GPU*ref() family for METAL and
METAL_HOST, and teaches GPUCommonDef.h about the Metal host and device
compilation passes.

The Metal backend targets MSL 4.1 and later only. That is what lets
GPUdDefault() expand to nothing: up to MSL 4.0 a member function's implicit
this is thread, which is wrong for objects living in device memory, and
pinning defaulted constructors to device made the same type unusable in
thread or threadgroup. MSL 4.1 makes an unannotated this generic, which is
the C++ semantics this codebase already assumes. The *ref() macros stay
explicit regardless: they are correct from the OpenCL port, explicit is never
slower than generic, and constant is not covered by generic pointers at all.

Inert unless METAL or METAL_HOST is defined.

Defines the GPUd()/GPUshared()/GPU*ref() family for __METAL__ and
__METAL_HOST__, and teaches GPUCommonDef.h about the Metal host and device
compilation passes.

The Metal backend targets MSL 4.1 and later only. That is what lets
GPUdDefault() expand to nothing: up to MSL 4.0 a member function's implicit
this is thread, which is wrong for objects living in device memory, and
pinning defaulted constructors to device made the same type unusable in
thread or threadgroup. MSL 4.1 makes an unannotated this generic, which is
the C++ semantics this codebase already assumes. The *ref() macros stay
explicit regardless: they are correct from the OpenCL port, explicit is never
slower than generic, and constant is not covered by generic pointers at all.

Inert unless __METAL__ or __METAL_HOST__ is defined.
@alibuild

alibuild commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 53569d4 at 2026-09-07 22:19:

## sw/BUILD/o2codechecker-latest/log
100% tests passed, 0 tests failed out of 1


## sw/BUILD/O2-full-system-test-latest/log
command alien-token-init had nonzero exit code 2


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep ' error:'
++ grep -v clang-diagnostic-error error-log.txt
grep: error-log.txt: binary file matches
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/d9831d7041b7a236f3b980d75891705a7f613582/slc9_x86-64/o2checkcode/1.0-local1/etc/modulefiles
++ alibuild-generate-module
+ HAS_BIN=
+ HAS_LIB=
+ HAS_CMAKE=
+ HAS_ROOT=
+ '[' 0 '!=' 0 ']'
+ cat
+ printf 'if ![ is-loaded '\''BASE/1.0'\'' ] {\n module load BASE/1.0\n}'
+ echo 'BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release'
BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release
+ FULL_BUILD_REQUIRES='Python-modules-list pytorch_cpuinfo alibuild-recipe-tools safe_int ninja-fortran MPFR bz2 CMake googlebenchmark Alice-GRID-Utils UUID FairCMakeModules O2-customization json-c defaults-release ninja double-conversion date'
+ echo 'FULL_BUILD_REQUIRES=Python-modules-list pytorch_cpuinfo alibuild-recipe-tools safe_int ninja-fortran MPFR bz2 CMake googlebenchmark Alice-GRID-Utils UUID FairCMakeModules O2-customization json-c defaults-release ninja double-conversion date'
FULL_BUILD_REQUIRES=Python-modules-list pytorch_cpuinfo alibuild-recipe-tools safe_int ninja-fortran MPFR bz2 CMake googlebenchmark Alice-GRID-Utils UUID FairCMakeModules O2-customization json-c defaults-release ninja double-conversion date
++ env
++ cut -f1 -d=
++ grep -v '^DEFAULT_'
++ grep -v PKGREVISION
++ grep -v ALIBUILD_RECIPE_TOOLS
++ grep REVISION
++ sed -e s/_REVISION//
+ for x in $(env | cut -f1 -d= | grep -v "^DEFAULT_" | grep -v PKGREVISION | grep -v ALIBUILD_RECIPE_TOOLS | grep REVISION | sed -e 's/_REVISION//')
++ eval 'echo $LIBFFI_REVISION'
+++ echo 14
+ REVISION_VALUE=14
++ eval 'echo $LIBFFI_VERSION'
+++ echo v3.2.1-alice1
+ VERSION_VALUE=v3.2.1-alice1
++ eval 'echo $LIBFFI_ROOT'
+++ echo /sw/slc9_x86-64/libffi/v3.2.1-alice1-14
+ ROOT_PATH_VALUE=/sw/slc9_x86-64/libffi/v3.2.1-alice1-14
+ '[' -z 14 ']'
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants