You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cuda.h 1.7 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_
  17. #define TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_
  18. typedef enum cudaError_enum {
  19. CUDA_SUCCESS = 0,
  20. CUDA_ERROR_INVALID_IMAGE = 1,
  21. CUDA_ERROR_DEINITIALIZED = 2,
  22. } CUresult;
  23. struct CUctx_st {
  24. int arch;
  25. };
  26. struct CUmod_st {
  27. int arch;
  28. };
  29. struct CUfunc_st {
  30. int arch;
  31. };
  32. struct CUstream_st {
  33. int arch;
  34. };
  35. typedef struct CUctx_st *CUcontext;
  36. typedef struct CUmod_st *CUmodule;
  37. typedef struct CUfunc_st *CUfunction;
  38. typedef struct CUstream_st *CUstream;
  39. CUresult cuModuleLoadData(CUmodule *module, const void *image);
  40. CUresult cuModuleGetFunction(CUfunction *hfunc, CUmodule hmod, const char *name);
  41. CUresult cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ,
  42. unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
  43. unsigned int sharedMemBytes, CUstream hStream, void **kernelParams, void **extra);
  44. CUresult cuModuleUnload(CUmodule hmod);
  45. #endif // TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_