aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaSYCL/bf16.cpp
blob: d1b4776f34044185a53d703bf0e52394c0197283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -triple spir64 -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -verify -fsyntax-only %s

template <typename Name, typename Func>
__attribute__((sycl_kernel)) void kernel(const Func &kernelFunc) {
  kernelFunc(); // expected-note {{called by 'kernel}}
}

void host_ok(void) {
  __bf16 A;
}

int main()
{  host_ok();
  __bf16 var; // expected-note {{'var' defined here}}
  kernel<class variables>([=]() {
    (void)var; // expected-error {{'var' requires 16 bit size '__bf16' type support, but target 'spir64' does not support it}}
    int B = sizeof(__bf16);
  });

  return 0;
}