| 1 |
// RUN: %clang_cc1 -emit-pch -o %t %s |
| 2 |
// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s |
| 3 |
// RUN: %clang_cc1 -emit-pch -fcuda-is-device -o %t-device %s |
| 4 |
// RUN: %clang_cc1 -fcuda-is-device -include-pch %t-device -fsyntax-only %s |
| 5 |
|
| 6 |
#ifndef HEADER |
| 7 |
#define HEADER |
| 8 |
// Header. |
| 9 |
|
| 10 |
#include "Inputs/cuda.h" |
| 11 |
|
| 12 |
void kcall(void (*kp)()) { |
| 13 |
kp<<<1, 1>>>(); |
| 14 |
} |
| 15 |
|
| 16 |
__global__ void kern() { |
| 17 |
} |
| 18 |
|
| 19 |
// Make sure that target overloaded functions remain |
| 20 |
// available as overloads after PCH deserialization. |
| 21 |
__host__ int overloaded_func(); |
| 22 |
__device__ int overloaded_func(); |
| 23 |
|
| 24 |
#else |
| 25 |
// Using the header. |
| 26 |
|
| 27 |
void test() { |
| 28 |
kcall(kern); |
| 29 |
kern<<<1, 1>>>(); |
| 30 |
overloaded_func(); |
| 31 |
} |
| 32 |
|
| 33 |
__device__ void test () { |
| 34 |
overloaded_func(); |
| 35 |
} |
| 36 |
#endif |