kernel-call.cu 733 B

1234567891011121314151617181920212223242526
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. #include "Inputs/cuda.h"
  3. __global__ void g1(int x) {}
  4. template <typename T> void t1(T arg) {
  5. g1<<<arg, arg>>>(1);
  6. }
  7. void h1(int x) {}
  8. int h2(int x) { return 1; }
  9. int main(void) {
  10. g1<<<1, 1>>>(42);
  11. g1(42); // expected-error {{call to global function g1 not configured}}
  12. g1<<<1>>>(42); // expected-error {{too few execution configuration arguments to kernel function call}}
  13. g1<<<1, 1, 0, 0, 0>>>(42); // expected-error {{too many execution configuration arguments to kernel function call}}
  14. t1(1);
  15. h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}}
  16. int (*fp)(int) = h2;
  17. fp<<<1, 1>>>(42); // expected-error {{must have void return type}}
  18. }