-
Notifications
You must be signed in to change notification settings - Fork 202
Description
Bug summary
I'm actually not sure if it's a bug in AdaptiveCPP or it's an issue with clang
I'm using RX 7900 GRE, which is gfx1100, but acpp doesn't recognize gfx1100 as the target
and acpp --acpp-targets=hip
would set the target to gfx906, so that might be the issue.
When using "cos" function in the code, it yields an error during the compilation.
vec.cpp:43:21: error: no matching function for call to 'cos'
43 | re_acc[i] = cos(in_acc[0]);
| ^~~
To Reproduce
Try to compile the code below(it's from Data Parallel C++ book)
#include <cassert>
#include <sycl/sycl.hpp>
#define M 32
using namespace sycl;
int main()
{
queue q;
marray<float, 4> input{1.0004f, 1e-4f, 1.4f, 14.0f};
marray<float, 4> res[M];
for (int i = 0; i < M; i++)
res[i] = {-(i + 1), -(i + 1), -(i + 1), -(i + 1)};
{
buffer in_buf(&input, range{1});
buffer re_buf(res, range{M});
q.submit([&](handler &cgh)
{
accessor re_acc{re_buf, cgh, read_write};
accessor in_acc{in_buf, cgh, read_only};
cgh.parallel_for(range<1>(M), [=](id<1> idx) {
int i = idx[0];
re_acc[i] = cos(in_acc[0]);
}); });
}
return 0;
}
If possible, provide a minimal reproducer. The shorter the reproducing code snippet is, the easier will it be for us to debug and understand the issue.
Expected behavior
A clear and concise description of what you expected to happen.
Describe your setup
Ubuntu 24.04
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
ROCm-6.2
acpp vec.cpp -o vec -O3 --acpp-targets=generic
Optional additional diagnostic information
`acpp --hipsycl-version
acpp [AdaptiveCpp compilation driver], Copyright (C) 2018-2024 Aksel Alpay and the AdaptiveCpp project
AdaptiveCpp version: 24.06.0+git.fca48591.20240810.branch.develop
Installation root: /home/minhee/env/adaptiveCPP
Plugin LLVM version: 18, can accelerate CPU: True
Available runtime backends:
librt-backend-omp.so
librt-backend-hip.so
Full configuration [can be overridden using environment variables or command line arguments]:
default-rocm-path: /opt/rocm
default-rocm-link-line: -Wl,-rpath=$HIPSYCL_ROCM_PATH/lib -Wl,-rpath=$HIPSYCL_ROCM_PATH/hip/lib -L/opt/rocm/lib -L/opt/rocm/hip/lib -lamdhip64
default-rocm-cxx-flags: -isystem $HIPSYCL_PATH/include/AdaptiveCpp/hipSYCL/std/hiplike -isystem /usr/lib/llvm-18/lib/clang/18/include/.. -U__FLOAT128__ -U__SIZEOF_FLOAT128__ -I$HIPSYCL_ROCM_PATH/include -I$HIPSYCL_ROCM_PATH/include --rocm-device-lib-path=$HIPSYCL_ROCM_PATH/amdgcn/bitcode --rocm-path=$HIPSYCL_ROCM_PATH -fhip-new-launch-api -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -D__HIP_ROCclr__
version-major: 24
version-minor: 06
version-patch: 0
version-suffix: +git.fca48591.20240810.branch.develop
plugin-llvm-version-major: 18
plugin-with-cpu-acceleration: true
default-clang: /usr/lib/llvm-18/bin/clang++
default-targets: generic
default-cpu-cxx: /usr/bin/c++
default-use-bootstrap-mode: false
default-is-dryrun: false
default-use-accelerated-cpu: true
default-clang-include-path: /usr/lib/llvm-18/lib/clang/18/include/..
default-sequential-link-line: -L/usr/lib/x86_64-linux-gnu -lboost_context -lboost_fiber -Wl,-rpath=/usr/lib/x86_64-linux-gnu
default-sequential-cxx-flags: -I/usr/include -D_ENABLE_EXTENDED_ALIGNED_STORAGE
default-omp-link-line: -L/usr/lib/x86_64-linux-gnu -lboost_context -lboost_fiber -Wl,-rpath=/usr/lib/x86_64-linux-gnu -fopenmp
default-omp-cxx-flags: -I/usr/include -fopenmp -D_ENABLE_EXTENDED_ALIGNED_STORAGE
default-is-explicit-multipass: false
default-save-temps: false`