Guest User

Untitled

a guest
Apr 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <hip/hip_runtime_api.h>
  2. #include <hip/hip_runtime.h>
  3.  
  4. #define kernel_name "kernel_blur1_s0_y_y___block_id_y"
  5. #define fileName "halide_asm.co"
  6.  
  7. #define HIP_CHECK(status) \
  8. if (status != hipSuccess) { \
  9. std::cout << "Got Status: " << status << " at Line: " << __LINE__ << std::endl; \
  10. exit(0); \
  11. }
  12.  
  13. int main() {
  14.  
  15. hipInit(0);
  16. hipDevice_t device;
  17. hipCtx_t context;
  18. hipDeviceGet(&device, 0);
  19. hipCtxCreate(&context, 0, device);
  20.  
  21. hipModule_t Module;
  22. hipFunction_t Function;
  23. HIP_CHECK(hipModuleLoad(&Module, fileName));
  24. HIP_CHECK(hipModuleGetFunction(&Function, Module, kernel_name));
  25.  
  26.  
  27. hipCtxDestroy(context);
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment