Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cuda.h File Reference
#include <sstream>
#include <stdexcept>
#include <cuda.h>
#include <cuda_runtime.h>
#include <glog/logging.h>
Include dependency graph for cuda.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tc::WithDevice
 

Namespaces

 tc
 

Macros

#define TC_CUDA_DRIVERAPI_ENFORCE(condition)
 
#define TC_NVRTC_CHECK(condition)
 
#define TC_CUDA_RUNTIMEAPI_ENFORCE(condition)
 

Functions

size_t tc::querySharedMemorySize ()
 

Macro Definition Documentation

#define TC_CUDA_DRIVERAPI_ENFORCE (   condition)
Value:
do { \
CUresult result = condition; \
if (result != CUDA_SUCCESS) { \
const char* msg; \
cuGetErrorName(result, &msg); \
std::stringstream ss; \
ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " << msg; \
LOG(WARNING) << ss.str(); \
throw std::runtime_error(ss.str().c_str()); \
} \
} while (0)

Copyright (c) 2017-present, Facebook, Inc.

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.

#define TC_CUDA_RUNTIMEAPI_ENFORCE (   condition)
Value:
do { \
cudaError_t result = condition; \
if (result != cudaSuccess) { \
std::stringstream ss; \
ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " \
<< cudaGetErrorString(result); \
LOG(WARNING) << ss.str(); \
throw std::runtime_error(ss.str().c_str()); \
} \
} while (0)
#define TC_NVRTC_CHECK (   condition)
Value:
do { \
nvrtcResult result = condition; \
if (result != NVRTC_SUCCESS) { \
std::stringstream ss; \
ss << "Error at: " << __FILE__ << ":" << __LINE__ << ": " \
<< nvrtcGetErrorString(result); \
LOG(WARNING) << ss.str(); \
throw std::runtime_error(ss.str().c_str()); \
} \
} while (0)