cmake/Modules/CMakeCUDACompilerABI.cu

27 lines
631 B
Plaintext
Raw Normal View History

2017-04-14 19:02:05 +02:00
#ifndef __CUDACC__
2018-08-09 18:06:22 +02:00
# error "A C or C++ compiler has been selected for CUDA"
2017-04-14 19:02:05 +02:00
#endif
#include "CMakeCompilerABI.h"
2023-12-07 09:12:54 +01:00
#include "CMakeCompilerCUDAArch.h"
2017-04-14 19:02:05 +02:00
int main(int argc, char* argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
2021-09-14 00:13:48 +02:00
require += info_byte_order_big_endian[argc];
require += info_byte_order_little_endian[argc];
2017-04-14 19:02:05 +02:00
#if defined(ABI_ID)
require += info_abi[argc];
#endif
2022-08-04 22:12:04 +02:00
static_cast<void>(argv);
2023-12-07 09:12:54 +01:00
if (!cmakeCompilerCUDAArch()) {
2022-08-04 22:12:04 +02:00
// Convince the compiler that the non-zero return value depends
// on the info strings so they are not optimized out.
return require ? -1 : 1;
}
return 0;
2017-04-14 19:02:05 +02:00
}