2
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2025-01-06 14:14:46 +08:00

The eigen_check macro doesn't exist anymore: use assert instead

This commit is contained in:
Benoit Steiner 2015-07-21 17:34:15 -07:00
parent 586d10f7e0
commit 0dda72316f

View File

@ -295,11 +295,11 @@ static void initializeDeviceProp() {
if (!m_devicePropInitialized) { if (!m_devicePropInitialized) {
int num_devices; int num_devices;
cudaError_t status = cudaGetDeviceCount(&num_devices); cudaError_t status = cudaGetDeviceCount(&num_devices);
eigen_check(status == cudaSuccess); assert(status == cudaSuccess);
m_deviceProperties = new cudaDeviceProp[num_devices]; m_deviceProperties = new cudaDeviceProp[num_devices];
for (int i = 0; i < num_devices; ++i) { for (int i = 0; i < num_devices; ++i) {
status = cudaGetDeviceProperties(&m_deviceProperties[i], i); status = cudaGetDeviceProperties(&m_deviceProperties[i], i);
eigen_check(status == cudaSuccess); assert(status == cudaSuccess);
} }
m_devicePropInitialized = true; m_devicePropInitialized = true;
} }
@ -330,8 +330,8 @@ class CudaStreamDevice : public StreamInterface {
} else { } else {
int num_devices; int num_devices;
cudaError_t err = cudaGetDeviceCount(&num_devices); cudaError_t err = cudaGetDeviceCount(&num_devices);
eigen_check(err == cudaSuccess); assert(err == cudaSuccess);
eigen_check(device < num_devices); assert(device < num_devices);
device_ = device; device_ = device;
} }
initializeDeviceProp(); initializeDeviceProp();
@ -343,16 +343,16 @@ class CudaStreamDevice : public StreamInterface {
} }
virtual void* allocate(size_t num_bytes) const { virtual void* allocate(size_t num_bytes) const {
cudaError_t err = cudaSetDevice(device_); cudaError_t err = cudaSetDevice(device_);
eigen_check(err == cudaSuccess); assert(err == cudaSuccess);
void* result; void* result;
err = cudaMalloc(&result, num_bytes); err = cudaMalloc(&result, num_bytes);
eigen_check(err == cudaSuccess); assert(err == cudaSuccess);
eigen_check(result != NULL); assert(result != NULL);
return result; return result;
} }
virtual void deallocate(void* buffer) const { virtual void deallocate(void* buffer) const {
cudaError_t err = cudaSetDevice(device_); cudaError_t err = cudaSetDevice(device_);
eigen_check(err == cudaSuccess); assert(err == cudaSuccess);
assert(buffer != NULL); assert(buffer != NULL);
err = cudaFree(buffer); err = cudaFree(buffer);
assert(err == cudaSuccess); assert(err == cudaSuccess);
@ -495,7 +495,7 @@ struct GpuDevice {
// FIXME: Should be device and kernel specific. // FIXME: Should be device and kernel specific.
static inline void setCudaSharedMemConfig(cudaSharedMemConfig config) { static inline void setCudaSharedMemConfig(cudaSharedMemConfig config) {
cudaError_t status = cudaDeviceSetSharedMemConfig(config); cudaError_t status = cudaDeviceSetSharedMemConfig(config);
eigen_check(status == cudaSuccess); assert(status == cudaSuccess);
} }
#endif #endif