-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zhiting Zhu <[email protected]>
- Loading branch information
Showing
17 changed files
with
2,066 additions
and
11,989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cava/samples/cuda_common_spec/cublas/blas_like_ext_unimplemented.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDADRV_UNIMPLEMENTED_H_ | ||
#define _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDADRV_UNIMPLEMENTED_H_ | ||
#include <cuda.h> | ||
|
||
CUresult CUDAAPI cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) { ava_unsupported; } | ||
|
||
CUresult CUDAAPI cuCtxGetSharedMemConfig(CUsharedconfig *pConfig) { ava_unsupported; } | ||
|
||
CUresult CUDAAPI cuFuncGetAttribute(int *pi, CUfunction_attribute attrib, CUfunction hfunc) { ava_unsupported; } | ||
|
||
CUresult CUDAAPI cuModuleLoadFatBinary(CUmodule *module, const void *fatCubin) { ava_unsupported; } | ||
|
||
CUresult CUDAAPI cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void *userData, unsigned int flags) { | ||
ava_unsupported; | ||
} | ||
|
||
CUresult CUDAAPI cuDeviceGetProperties(CUdevprop *prop, CUdevice dev) { ava_unsupported; } | ||
|
||
CUresult cuGetExportTable(const void **ppExportTable, const CUuuid *pExportTableId) { ava_unsupported; } | ||
|
||
CUresult CUDAAPI cuOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, CUfunction func, int blockSize, | ||
size_t dynamicSMemSize) { | ||
ava_argument(numBlocks) { | ||
ava_out; | ||
ava_buffer(1); | ||
} | ||
|
||
ava_unsupported; | ||
} | ||
|
||
CUresult CUDAAPI cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, CUfunction func, int blockSize, | ||
size_t dynamicSMemSize, unsigned int flags) { | ||
ava_argument(numBlocks) { | ||
ava_out; | ||
ava_buffer(1); | ||
} | ||
|
||
ava_unsupported; | ||
} | ||
|
||
#endif // _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDADRV_UNIMPLEMENTED_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#ifndef _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDNN_H_ | ||
#define _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDNN_H_ | ||
#include <cudnn.h> | ||
|
||
/* Tensor Bias addition : C = alpha * A + beta * C */ | ||
cudnnStatus_t CUDNNWINAPI cudnnAddTensor(cudnnHandle_t handle, const void *alpha, const cudnnTensorDescriptor_t aDesc, | ||
const void *A, const void *beta, const cudnnTensorDescriptor_t cDesc, | ||
void *C) { | ||
ava_async; | ||
ava_argument(handle) ava_handle; | ||
ava_argument(alpha) { | ||
ava_type_cast(const double *); | ||
ava_in; | ||
ava_buffer(1); | ||
} | ||
ava_argument(aDesc) ava_handle; | ||
ava_argument(A) ava_opaque; | ||
ava_argument(beta) { | ||
ava_type_cast(const double *); | ||
ava_in; | ||
ava_buffer(1); | ||
} | ||
ava_argument(cDesc) ava_handle; | ||
ava_argument(C) ava_opaque; | ||
} | ||
|
||
/* Convolution functions: All of the form "output = alpha * Op(inputs) + beta * output" */ | ||
|
||
cudnnStatus_t CUDNNWINAPI cudnnFindConvolutionForwardAlgorithmEx( | ||
cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnFilterDescriptor_t wDesc, | ||
const void *w, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t yDesc, void *y, | ||
const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionFwdAlgoPerf_t *perfResults, void *workSpace, | ||
size_t workSpaceSizeInBytes) { | ||
ava_argument(handle) ava_handle; | ||
ava_argument(xDesc) ava_handle; | ||
ava_argument(x) ava_opaque; | ||
ava_argument(wDesc) ava_handle; | ||
ava_argument(w) ava_opaque; | ||
ava_argument(convDesc) ava_handle; | ||
ava_argument(yDesc) ava_handle; | ||
ava_argument(y) ava_opaque; | ||
ava_argument(returnedAlgoCount) { | ||
ava_out; | ||
ava_buffer(1); | ||
} | ||
ava_argument(perfResults) { | ||
ava_out; | ||
cu_in_out_buffer(requestedAlgoCount, returnedAlgoCount); | ||
} | ||
ava_argument(workSpace) ava_opaque; | ||
} | ||
|
||
/* Helper function to return the minimum size of the workspace to be passed to the convolution given an algo*/ | ||
cudnnStatus_t CUDNNWINAPI cudnnGetConvolutionBackwardFilterWorkspaceSize( | ||
cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnTensorDescriptor_t dyDesc, | ||
const cudnnConvolutionDescriptor_t convDesc, const cudnnFilterDescriptor_t gradDesc, | ||
cudnnConvolutionBwdFilterAlgo_t algo, size_t *sizeInBytes) { | ||
ava_argument(handle) ava_handle; | ||
ava_argument(xDesc) ava_handle; | ||
ava_argument(dyDesc) ava_handle; | ||
ava_argument(convDesc) ava_handle; | ||
ava_argument(gradDesc) ava_handle; | ||
ava_argument(sizeInBytes) { | ||
ava_out; | ||
ava_buffer(1); | ||
} | ||
} | ||
|
||
/* | ||
* Derives a tensor descriptor from layer data descriptor for BatchNormalization | ||
* scale, invVariance, bnBias, bnScale tensors. Use this tensor desc for | ||
* bnScaleBiasMeanVarDesc and bnScaleBiasDiffDesc in Batch Normalization forward and backward functions. | ||
*/ | ||
cudnnStatus_t CUDNNWINAPI cudnnDeriveBNTensorDescriptor(cudnnTensorDescriptor_t derivedBnDesc, | ||
const cudnnTensorDescriptor_t xDesc, | ||
cudnnBatchNormMode_t mode) { | ||
ava_async; | ||
ava_argument(derivedBnDesc) ava_handle; | ||
ava_argument(xDesc) ava_handle; | ||
} | ||
|
||
#endif // _AVA_CAVA_SAMPLES_CUDA_COMMON_SPEC_CUDNN_H_ |
Oops, something went wrong.