[llvm-bugs] [Bug 50041] New: Problem calling atomics with pointers to the generic address space

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 20 10:01:55 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50041

            Bug ID: 50041
           Summary: Problem calling atomics with pointers to the generic
                    address space
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: drohr at jwdt.org
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

Created attachment 24773
  --> https://bugs.llvm.org/attachment.cgi?id=24773&action=edit
Testcase

The attached testcase compiles with clang 11 / clang 12 / clang 13 trunk until
at least 23.2., but it fails with the current trunk (I was using clang version
13.0.0 (https://github.com/llvm/llvm-project.git
6d0fef48609cbec9579716b77998059501969352)).

compile command:
clang++ -O0 -cl-std=clc++ -x cl -emit-llvm --target=spir64-unknown-unknown
-Xclang -fdenormal-fp-math-f32=ieee -cl-mad-enable -cl-no-signed-zeros
-ferror-limit=1000 -Xclang -finclude-default-header
-Dcl_clang_storage_class_specifiers -I../. -I../DataTypes -I../Definitions
-I../Base -I../SliceTracker -I../Common -I../Merger -I../Refit -I../TRDTracking
-I../ITS -I../dEdx -I../TPCConvert -I../TPCFastTransformation
-I../DataCompression -I../TPCClusterFinder -I../Global -I ../GPUUtils
-I/home/qon/alice/O2/DataFormats/Detectors/TPC/include
-I/home/qon/alice/O2/Detectors/Base/include
-I/home/qon/alice/O2/Detectors/Base/src
-I/home/qon/alice/O2/Common/MathUtils/include
-I/home/qon/alice/O2/DataFormats/Headers/include
-I/home/qon/alice/O2/Detectors/TRD/base/include
-I/home/qon/alice/O2/Detectors/TRD/base/src
-I/home/qon/alice/O2/Detectors/ITSMFT/ITS/tracking/include
-I/home/qon/alice/O2/Detectors/ITSMFT/ITS/tracking/cuda/include
-I/home/qon/alice/O2/Common/Constants/include
-I/home/qon/alice/O2/DataFormats/common/include
-I/home/qon/alice/O2/DataFormats/Detectors/TRD/include
-I/home/qon/alice/O2/DataFormats/Reconstruction/include
-I/home/qon/alice/O2/DataFormats/Reconstruction/src -DGPUCA_STANDALONE
-DGPUCA_GPULIBRARY=OCL -DNDEBUG -D__OPENCLCPP__ -DHAVE_O2HEADERS
-DGPUCA_TPC_GEOMETRY_O2 -c

With the current clang trunk, I am getting errors like:
../Common/GPUCommonMath.h:471:3: error: no matching function for call to
'atomic_max'
  ::atomic_max(addr, val);
  ^~~~~~~~~~~~
../Common/GPUCommonMath.h:97:20: note: in instantiation of function template
specialization 'o2::gpu::GPUCommonMath::AtomicMaxInt<volatile __generic
unsigned int, unsigned int>' requested here
    GPUCommonMath::AtomicMaxInt(addr, val);
                   ^
../SliceTracker/GPUTPCSliceData.h:217:11: note: in instantiation of function
template specialization 'o2::gpu::GPUCommonMath::AtomicMax<unsigned int>'
requested here
  CAMath::AtomicMax(&mHitWeights[row.mHitNumberOffset + hitIndex], weight);
          ^
../Common/GPUCommonMath.h:471:5: note: candidate function not viable: cannot
pass pointer to address space '__generic' as a pointer to address space
'__global' in 1st argument
  ::atomic_max(addr, val);
    ^          ~~~~
../Common/GPUCommonMath.h:471:5: note: candidate function not viable: cannot
pass pointer to address space '__generic' as a pointer to address space
'__local' in 1st argument
  ::atomic_max(addr, val);
    ^          ~~~~
../Common/GPUCommonMath.h:471:5: note: candidate function not viable: no known
conversion from 'volatile __generic unsigned int *__private' to 'volatile
__global int *' for 1st argument
  ::atomic_max(addr, val);
    ^          ~~~~
../Common/GPUCommonMath.h:471:5: note: candidate function not viable: no known
conversion from 'volatile __generic unsigned int *__private' to 'volatile
__local int *' for 1st argument
  ::atomic_max(addr, val);
    ^          ~~~~
../Common/GPUCommonMath.h:453:10: error: no matching function for call to
'atomic_add'
  return ::atomic_add(addr, val);
         ^~~~~~~~~~~~

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210420/d298884f/attachment.html>


More information about the llvm-bugs mailing list