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
112 lines
5.2 KiB
C
112 lines
5.2 KiB
C
// RUN: %clang_cc1 %s -fopenacc -verify
|
|
|
|
typedef struct IsComplete {
|
|
struct S { int A; } CompositeMember;
|
|
int ScalarMember;
|
|
float ArrayMember[5];
|
|
void *PointerMember;
|
|
} Complete;
|
|
void uses(int IntParam, short *PointerParam, float ArrayParam[5], Complete CompositeParam) {
|
|
int LocalInt;
|
|
short *LocalPointer;
|
|
float LocalArray[5];
|
|
Complete LocalComposite;
|
|
// Check Appertainment:
|
|
#pragma acc data create(LocalInt)
|
|
;
|
|
#pragma acc enter data create(LocalInt)
|
|
|
|
// expected-warning@+1{{OpenACC clause name 'pcreate' is a deprecated clause name and is now an alias for 'create'}}
|
|
#pragma acc data pcreate(LocalInt)
|
|
;
|
|
|
|
// expected-warning@+1{{OpenACC clause name 'present_or_create' is a deprecated clause name and is now an alias for 'create'}}
|
|
#pragma acc data present_or_create(LocalInt)
|
|
;
|
|
|
|
// Valid cases:
|
|
#pragma acc data create(LocalInt, LocalPointer, LocalArray)
|
|
;
|
|
#pragma acc data create(LocalArray[2:1])
|
|
;
|
|
#pragma acc data create(zero:LocalArray[2:1])
|
|
;
|
|
|
|
#pragma acc data create(LocalComposite.ScalarMember, LocalComposite.ScalarMember)
|
|
;
|
|
|
|
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
|
|
#pragma acc data create(1 + IntParam)
|
|
;
|
|
|
|
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
|
|
#pragma acc data create(+IntParam)
|
|
;
|
|
|
|
// expected-error@+1{{OpenACC sub-array length is unspecified and cannot be inferred because the subscripted value is not an array}}
|
|
#pragma acc data create(PointerParam[2:])
|
|
;
|
|
|
|
// expected-error@+1{{OpenACC sub-array specified range [2:5] would be out of the range of the subscripted array size of 5}}
|
|
#pragma acc data create(ArrayParam[2:5])
|
|
;
|
|
|
|
// expected-error@+2{{OpenACC sub-array specified range [2:5] would be out of the range of the subscripted array size of 5}}
|
|
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
|
|
#pragma acc data create((float*)ArrayParam[2:5])
|
|
;
|
|
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
|
|
#pragma acc data create((float)ArrayParam[2])
|
|
;
|
|
// expected-error@+2{{unknown modifier 'invalid' in OpenACC modifier-list on 'create' clause}}
|
|
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
|
|
#pragma acc data create(invalid:(float)ArrayParam[2])
|
|
;
|
|
|
|
// expected-error@+2{{OpenACC 'exit data' construct must have at least one 'copyout', 'delete', or 'detach' clause}}
|
|
// expected-error@+1{{OpenACC 'create' clause is not valid on 'exit data' directive}}
|
|
#pragma acc exit data create(LocalInt)
|
|
// expected-error@+2{{OpenACC 'host_data' construct must have at least one 'use_device' clause}}
|
|
// expected-error@+1{{OpenACC 'pcreate' clause is not valid on 'host_data' directive}}
|
|
#pragma acc host_data pcreate(LocalInt)
|
|
;
|
|
}
|
|
|
|
void ModList() {
|
|
int V1;
|
|
// expected-error@+4{{OpenACC 'always' modifier not valid on 'create' clause}}
|
|
// expected-error@+3{{OpenACC 'alwaysin' modifier not valid on 'create' clause}}
|
|
// expected-error@+2{{OpenACC 'alwaysout' modifier not valid on 'create' clause}}
|
|
// expected-error@+1{{OpenACC 'readonly' modifier not valid on 'create' clause}}
|
|
#pragma acc data create(always, alwaysin, alwaysout, zero, readonly, capture: V1)
|
|
// expected-error@+1{{OpenACC 'always' modifier not valid on 'create' clause}}
|
|
#pragma acc data create(always: V1)
|
|
// expected-error@+1{{OpenACC 'alwaysin' modifier not valid on 'create' clause}}
|
|
#pragma acc data create(alwaysin: V1)
|
|
// expected-error@+1{{OpenACC 'alwaysout' modifier not valid on 'create' clause}}
|
|
#pragma acc data create(alwaysout: V1)
|
|
// expected-error@+1{{OpenACC 'readonly' modifier not valid on 'create' clause}}
|
|
#pragma acc data create(readonly: V1)
|
|
#pragma acc data create(zero: V1)
|
|
#pragma acc data create(zero, capture: V1)
|
|
|
|
// expected-error@+5{{OpenACC 'always' modifier not valid on 'create' clause}}
|
|
// expected-error@+4{{OpenACC 'alwaysin' modifier not valid on 'create' clause}}
|
|
// expected-error@+3{{OpenACC 'alwaysout' modifier not valid on 'create' clause}}
|
|
// expected-error@+2{{OpenACC 'readonly' modifier not valid on 'create' clause}}
|
|
// expected-error@+1{{OpenACC 'capture' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(always, alwaysin, alwaysout, zero, readonly, capture: V1)
|
|
// expected-error@+1{{OpenACC 'always' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(always: V1)
|
|
// expected-error@+1{{OpenACC 'alwaysin' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(alwaysin: V1)
|
|
// expected-error@+1{{OpenACC 'alwaysout' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(alwaysout: V1)
|
|
// expected-error@+1{{OpenACC 'readonly' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(readonly: V1)
|
|
// expected-error@+1{{OpenACC 'capture' modifier not valid on 'create' clause}}
|
|
#pragma acc enter data create(capture: V1)
|
|
|
|
#pragma acc enter data create(zero: V1)
|
|
}
|