file4.cu 491 B

1234567891011121314151617181920212223
  1. #include <iostream>
  2. #include "file1.h"
  3. #include "file2.h"
  4. result_type __device__ file1_func(int x);
  5. result_type_dynamic __device__ file2_func(int x);
  6. static __global__ void file4_kernel(result_type& r, int x)
  7. {
  8. // call static_func which is a method that is defined in the
  9. // static library that is always out of date
  10. r = file1_func(x);
  11. result_type_dynamic rd = file2_func(x);
  12. }
  13. int file4_launch_kernel(int x)
  14. {
  15. result_type r;
  16. file4_kernel<<<1, 1>>>(r, x);
  17. return r.sum;
  18. }