main.cpp 461 B

12345678910111213141516171819202122232425
  1. #include "file1.h"
  2. #include "file2.h"
  3. #ifdef _WIN32
  4. # define IMPORT __declspec(dllimport)
  5. #else
  6. # define IMPORT
  7. #endif
  8. IMPORT int choose_cuda_device();
  9. IMPORT int call_cuda_seperable_code(int x);
  10. IMPORT int mixed_launch_kernel(int x);
  11. int main(int argc, char** argv)
  12. {
  13. int ret = choose_cuda_device();
  14. if (ret) {
  15. return 0;
  16. }
  17. int r1 = call_cuda_seperable_code(42);
  18. int r2 = mixed_launch_kernel(42);
  19. return (r1 == 42 || r2 == 42) ? 1 : 0;
  20. }