
Added option -foffload-implicit-host-device-templates which is off by default. When the option is on, template functions and specializations without host/device attributes have implicit host device attributes. They can be overridden by device template functions with the same signagure. They are emitted on device side only if they are used on device side. This feature is added as an extension. `__has_extension(cuda_implicit_host_device_templates)` can be used to check whether it is enabled. This is to facilitate using standard C++ headers for device. Fixes: https://github.com/llvm/llvm-project/issues/69956 Fixes: SWDEV-428314
14 lines
496 B
Plaintext
14 lines
496 B
Plaintext
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu %s -o - \
|
|
// RUN: | FileCheck -check-prefix=NOHDT %s
|
|
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu %s -o - \
|
|
// RUN: -foffload-implicit-host-device-templates \
|
|
// RUN: | FileCheck -check-prefix=HDT %s
|
|
|
|
// NOHDT: no_implicit_host_device_templates
|
|
// HDT: has_implicit_host_device_templates
|
|
#if __has_extension(cuda_implicit_host_device_templates)
|
|
int has_implicit_host_device_templates();
|
|
#else
|
|
int no_implicit_host_device_templates();
|
|
#endif
|