main.cpp 477 B

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