|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * Copyright 2020 Huawei Technologies Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- #ifndef TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_
- #define TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_
-
- typedef enum cudaError_enum {
- CUDA_SUCCESS = 0,
- CUDA_ERROR_INVALID_IMAGE = 1,
- CUDA_ERROR_DEINITIALIZED = 2,
- } CUresult;
-
- struct CUctx_st {
- int arch;
- };
- struct CUmod_st {
- int arch;
- };
- struct CUfunc_st {
- int arch;
- };
- struct CUstream_st {
- int arch;
- };
-
- typedef struct CUctx_st *CUcontext;
- typedef struct CUmod_st *CUmodule;
- typedef struct CUfunc_st *CUfunction;
- typedef struct CUstream_st *CUstream;
-
- CUresult cuModuleLoadData(CUmodule *module, const void *image);
- CUresult cuModuleGetFunction(CUfunction *hfunc, CUmodule hmod, const char *name);
- CUresult cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ,
- unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
- unsigned int sharedMemBytes, CUstream hStream, void **kernelParams, void **extra);
- CUresult cuModuleUnload(CUmodule hmod);
-
- #endif // TESTS_UT_STUB_RUNTIME_INCLUDE_CUDA_H_
|