| 1 |
|
| 2 |
enable_language (HIP) |
| 3 |
include(CheckSourceCompiles) |
| 4 |
|
| 5 |
check_source_compiles(HIP "I don't build" SHOULD_FAIL) |
| 6 |
if(SHOULD_FAIL) |
| 7 |
message(SEND_ERROR "invalid HIP source didn't fail.") |
| 8 |
endif() |
| 9 |
|
| 10 |
check_source_compiles(HIP [=[ |
| 11 |
#include <vector> |
| 12 |
__device__ int d_func() { } |
| 13 |
int main() { |
| 14 |
return 0; |
| 15 |
} |
| 16 |
]=] |
| 17 |
SHOULD_BUILD) |
| 18 |
if(NOT SHOULD_BUILD) |
| 19 |
message(SEND_ERROR "Test fail for valid HIP source.") |
| 20 |
endif() |
| 21 |
|
| 22 |
check_source_compiles(HIP "void l(char const (&x)[2]){}; int main() { l(\"\\n\"); return 0;}" |
| 23 |
SHOULD_BUILD_COMPLEX) |
| 24 |
|
| 25 |
if(NOT SHOULD_BUILD_COMPLEX) |
| 26 |
message(SEND_ERROR "Test fail for valid HIP complex source.") |
| 27 |
endif() |