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
129 lines
6.2 KiB
HLSL
129 lines
6.2 KiB
HLSL
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -fsyntax-only -verify %s
|
|
|
|
typedef vector<float, 3> float3;
|
|
typedef vector<double, 2> double2;
|
|
typedef vector<double, 3> double3;
|
|
|
|
|
|
// expected-error@+1 {{class template 'RWBuffer' requires template arguments}}
|
|
RWBuffer BufferErr1;
|
|
|
|
// expected-error@+1 {{too few template arguments for class template 'RWBuffer'}}
|
|
RWBuffer<> BufferErr2;
|
|
|
|
// test implicit RWBuffer concept
|
|
RWBuffer<int> r1;
|
|
RWBuffer<float> r2;
|
|
RWBuffer<float3> Buff;
|
|
RWBuffer<double2> r4;
|
|
|
|
// expected-error@+4 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{template declaration from hidden source: template <typename element_type> requires __is_typed_resource_element_compatible<element_type> class RWBuffer}}
|
|
// expected-note@*:* {{because 'RWBuffer<int>' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(hlsl::RWBuffer<int>)' evaluated to false}}
|
|
RWBuffer<RWBuffer<int> > r5;
|
|
|
|
struct s {
|
|
int x;
|
|
};
|
|
|
|
struct Empty {};
|
|
|
|
template<typename T> struct TemplatedBuffer {
|
|
T a;
|
|
};
|
|
|
|
template<typename T> struct TemplatedVector {
|
|
vector<T, 4> v;
|
|
};
|
|
|
|
// structs not allowed
|
|
// expected-error@+4 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{template declaration from hidden source: template <typename element_type> requires __is_typed_resource_element_compatible<element_type> class RWBuffer}}
|
|
// expected-note@*:* {{because 's' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(s)' evaluated to false}}
|
|
RWBuffer<s> r6;
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'Empty' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(Empty)' evaluated to false}}
|
|
RWBuffer<Empty> r7;
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'TemplatedBuffer<int>' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(TemplatedBuffer<int>)' evaluated to false}}
|
|
RWBuffer<TemplatedBuffer<int> > r8;
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'TemplatedVector<int>' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(TemplatedVector<int>)' evaluated to false}}
|
|
RWBuffer<TemplatedVector<int> > r9;
|
|
|
|
// arrays not allowed
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'half[4]' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(half[4])' evaluated to false}}
|
|
RWBuffer<half[4]> r10;
|
|
|
|
typedef vector<int, 8> int8;
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'int8' (aka 'vector<int, 8>') does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<int, 8>)' evaluated to false}}
|
|
RWBuffer<int8> r11;
|
|
|
|
typedef int MyInt;
|
|
RWBuffer<MyInt> r12;
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'bool' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(bool)' evaluated to false}}
|
|
RWBuffer<bool> r13;
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'vector<bool, 2>' (vector of 2 'bool' values) does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<bool, 2>)' evaluated to false}}
|
|
RWBuffer<vector<bool, 2>> r14;
|
|
|
|
enum numbers { one, two, three };
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'numbers' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(numbers)' evaluated to false}}
|
|
RWBuffer<numbers> r15;
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'double3' (aka 'vector<double, 3>') does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<double, 3>)' evaluated to false}}
|
|
RWBuffer<double3> r16;
|
|
|
|
|
|
struct threeDoubles {
|
|
double a;
|
|
double b;
|
|
double c;
|
|
};
|
|
|
|
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
|
|
// expected-note@*:* {{because 'threeDoubles' does not satisfy '__is_typed_resource_element_compatible'}}
|
|
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(threeDoubles)' evaluated to false}}
|
|
RWBuffer<threeDoubles> BufferErr3;
|
|
|
|
|
|
[numthreads(1,1,1)]
|
|
void main() {
|
|
(void)Buff.__handle; // expected-error {{'__handle' is a private member of 'hlsl::RWBuffer<vector<float, 3>>'}}
|
|
// expected-note@* {{implicitly declared private here}}
|
|
}
|
|
|
|
// expected-error@+2 {{class template 'RWBuffer' requires template arguments}}
|
|
// expected-note@*:* {{template declaration from hidden source: template <typename element_type> requires __is_typed_resource_element_compatible<element_type> class RWBuffer {}}}
|
|
void f1(RWBuffer B) {}
|
|
|
|
// expected-error@+2 {{class template 'RWBuffer' requires template arguments}}
|
|
// expected-note@*:* {{template declaration from hidden source: template <typename element_type> requires __is_typed_resource_element_compatible<element_type> class RWBuffer {}}}
|
|
RWBuffer f2();
|
|
|
|
struct S {
|
|
// expected-error@+2 {{class template 'RWBuffer' requires template arguments}}
|
|
// expected-note@*:* {{template declaration from hidden source: template <typename element_type> requires __is_typed_resource_element_compatible<element_type> class RWBuffer {}}}
|
|
RWBuffer B;
|
|
};
|