| 1 |
// RUN: %clang_cc1 -triple spir-unknown-unknown -verify -finclude-default-header -cl-std=CL3.0 -cl-ext=-cl_intel_subgroups,-cl_intel_subgroup_buffer_prefetch,-cl_intel_subgroups_char,-cl_intel_subgroups_short,-cl_intel_subgroups_long,-cl_intel_bfloat16_conversions,-cl_intel_subgroup_local_block_io,-cl_intel_device_side_avc_motion_estimation %s |
| 2 |
// RUN: %clang_cc1 -triple spir-unknown-unknown -verify -finclude-default-header -cl-std=CL3.0 %s |
| 3 |
|
| 4 |
#if defined(cl_intel_subgroups) && defined(cl_intel_subgroup_buffer_prefetch) && defined(cl_intel_subgroups_char) && defined(cl_intel_subgroups_short) && defined(cl_intel_subgroups_long) && defined(cl_intel_bfloat16_conversions) && defined(cl_intel_subgroup_local_block_io) && defined(cl_intel_device_side_avc_motion_estimation) |
| 5 |
// expected-no-diagnostics |
| 6 |
#endif |
| 7 |
|
| 8 |
uint test1(read_only image2d_t im, int2 i) { |
| 9 |
return intel_sub_group_block_read(im, i); |
| 10 |
} |
| 11 |
#if !defined(cl_intel_subgroups) |
| 12 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_read'}} |
| 13 |
#endif |
| 14 |
|
| 15 |
void test2(const __global uint *p) { |
| 16 |
return intel_sub_group_block_prefetch_ui(p); |
| 17 |
} |
| 18 |
#if !defined(cl_intel_subgroup_buffer_prefetch) |
| 19 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_prefetch_ui'}} |
| 20 |
#endif |
| 21 |
|
| 22 |
uchar test3(read_only image2d_t im, int2 i) { |
| 23 |
return intel_sub_group_block_read_uc(im, i); |
| 24 |
} |
| 25 |
#if !defined(cl_intel_subgroups_char) |
| 26 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_read_uc'}} |
| 27 |
#endif |
| 28 |
|
| 29 |
ushort test4(const __local ushort* p) { |
| 30 |
return intel_sub_group_block_read_us(p); |
| 31 |
} |
| 32 |
#if !defined(cl_intel_subgroups_short) |
| 33 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_read_us'}} |
| 34 |
#endif |
| 35 |
|
| 36 |
ulong test5(const __global ulong* p) { |
| 37 |
return intel_sub_group_block_read_ul(p); |
| 38 |
} |
| 39 |
#if !defined(cl_intel_subgroups_long) |
| 40 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_read_ul'}} |
| 41 |
#endif |
| 42 |
|
| 43 |
ushort test6(float f) { |
| 44 |
return intel_convert_bfloat16_as_ushort(f); |
| 45 |
} |
| 46 |
#if !defined(cl_intel_bfloat16_conversions) |
| 47 |
// expected-error@-3{{use of undeclared identifier 'intel_convert_bfloat16_as_ushort'}} |
| 48 |
#endif |
| 49 |
|
| 50 |
uint test7(const __local uint* p) { |
| 51 |
return intel_sub_group_block_read(p); |
| 52 |
} |
| 53 |
#if !defined(cl_intel_subgroup_local_block_io) |
| 54 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_block_read'}} |
| 55 |
#endif |
| 56 |
|
| 57 |
uchar test8(uchar slice_type, uchar qp) { |
| 58 |
return intel_sub_group_avc_mce_get_default_inter_base_multi_reference_penalty(slice_type, qp); |
| 59 |
} |
| 60 |
#if !defined(cl_intel_device_side_avc_motion_estimation) |
| 61 |
// expected-error@-3{{use of undeclared identifier 'intel_sub_group_avc_mce_get_default_inter_base_multi_reference_penalty'}} |
| 62 |
#endif |