CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
68 lines
4.2 KiB
Common Lisp
68 lines
4.2 KiB
Common Lisp
// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -cl-std=CL2.0
|
|
// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DGENERIC
|
|
// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DCONSTANT
|
|
// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DLOCAL
|
|
|
|
/* USM (unified shared memory) extension for OpenCLC 2.0 adds two new address
|
|
* spaces: global_device and global_host that are a subset of __global address
|
|
* space. As ISO/IEC TR 18037 5.1.3 declares - it's possible to implicitly
|
|
* convert a subset address space to a superset address space, while conversion
|
|
* in a reversed direction could be achieved only with an explicit cast */
|
|
|
|
#ifdef GENERIC
|
|
#define AS_COMP __generic
|
|
#else
|
|
#define AS_COMP __global
|
|
#endif // GENERIC
|
|
|
|
#ifdef CONSTANT
|
|
#define AS_INCOMP __constant
|
|
#elif LOCAL
|
|
#define AS_INCOMP __local
|
|
#else // PRIVATE
|
|
#define AS_INCOMP __private
|
|
#endif // CONSTANT
|
|
|
|
void test(AS_COMP int *arg_comp,
|
|
__attribute__((opencl_global_device)) int *arg_device,
|
|
__attribute__((opencl_global_host)) int *arg_host) {
|
|
AS_COMP int *var_glob1 = arg_device;
|
|
AS_COMP int *var_glob2 = arg_host;
|
|
AS_COMP int *var_glob3 = (AS_COMP int *)arg_device;
|
|
AS_COMP int *var_glob4 = (AS_COMP int *)arg_host;
|
|
arg_device = (__attribute__((opencl_global_device)) int *)arg_comp;
|
|
arg_host = (__attribute__((opencl_global_host)) int *)arg_comp;
|
|
#ifdef GENERIC
|
|
// expected-error@+6{{assigning '__generic int *__private' to '__global_device int *__private' changes address space of pointer}}
|
|
// expected-error@+6{{assigning '__generic int *__private' to '__global_host int *__private' changes address space of pointer}}
|
|
#else
|
|
// expected-error@+3{{assigning '__global int *__private' to '__global_device int *__private' changes address space of pointer}}
|
|
// expected-error@+3{{assigning '__global int *__private' to '__global_host int *__private' changes address space of pointer}}
|
|
#endif // GENERIC
|
|
arg_device = arg_comp;
|
|
arg_host = arg_comp;
|
|
|
|
#ifdef CONSTANT
|
|
// expected-error@+15{{initializing '__constant int *__private' with an expression of type '__global_device int *__private' changes address space of pointer}}
|
|
// expected-error@+15{{initializing '__constant int *__private' with an expression of type '__global_host int *__private' changes address space of pointer}}
|
|
// expected-error@+15{{initializing '__constant int *__private' with an expression of type '__global_device int *' changes address space of pointer}}
|
|
// expected-error@+16{{initializing '__constant int *__private' with an expression of type '__global_host int *' changes address space of pointer}}
|
|
#elif LOCAL
|
|
// expected-error@+10{{initializing '__local int *__private' with an expression of type '__global_device int *__private' changes address space of pointer}}
|
|
// expected-error@+10{{initializing '__local int *__private' with an expression of type '__global_host int *__private' changes address space of pointer}}
|
|
// expected-error@+10{{initializing '__local int *__private' with an expression of type '__global_device int *' changes address space of pointer}}
|
|
// expected-error@+11{{initializing '__local int *__private' with an expression of type '__global_host int *' changes address space of pointer}}
|
|
#else // PRIVATE
|
|
// expected-error@+5{{initializing '__private int *__private' with an expression of type '__global_device int *__private' changes address space of pointer}}
|
|
// expected-error@+5{{initializing '__private int *__private' with an expression of type '__global_host int *__private' changes address space of pointer}}
|
|
// expected-error@+5{{initializing '__private int *__private' with an expression of type '__global_device int *' changes address space of pointer}}
|
|
// expected-error@+6{{initializing '__private int *__private' with an expression of type '__global_host int *' changes address space of pointer}}
|
|
#endif // CONSTANT
|
|
AS_INCOMP int *var_incomp1 = arg_device;
|
|
AS_INCOMP int *var_incomp2 = arg_host;
|
|
AS_INCOMP int *var_incomp3 =
|
|
(__attribute__((opencl_global_device)) int *)arg_device;
|
|
AS_INCOMP int *var_incomp4 =
|
|
(__attribute__((opencl_global_host)) int *)arg_host;
|
|
}
|