| Issue |
184856
|
| Summary |
Use of host function 'deallocate' in a host/device function error in c++20 code built for AMD GPU
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
efwright
|
We have an error building a Kokkos-based app for AMD MI300A GPUs. We've reduced the code to a few lines while still getting the same error message. The following code produces an error when using the AMD gfx942 target.
`#include <string>
class LabeledObject
{ std::string label; public: LabeledObject(); virtual ~LabeledObject(); }
;
class Describable : virtual public LabeledObject
{ public: virtual ~Describable(); virtual std::string describe() = 0; }
;
template <class Scalar>
class ScalarProdBase : virtual public Describable
{
public:
std::string describe()
{ return "foo"; }
protected:
virtual bool bar() = 0;
};
template class ScalarProdBase<double>;`
I'm using the following command to build:
`clang++ --std=c++20 -xhip -o repro.o -c repro.cpp --offload-arch=gfx942`
Notably, the error does not happen when using --std=c++17, but the code need c++20 for other parts.
This is the error output I see:
`In file included from <built-in>:1:
In file included from /llvm-dir/lib/clang/23/include/__clang_hip_runtime_wrapper.h:151:
In file included from /llvm-dir/lib/clang/23/include/cuda_wrappers/complex:35:
In file included from /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/stdexcept:39:
In file included from /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/string:43:
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/allocator.h:210:25: error:
reference to __host__ function 'deallocate' in __host__ __device__
function
210 | __allocator_base<_Tp>::deallocate(__p, __n);
|`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs