Skip to content
Snippets Groups Projects
Commit ca86abf2 authored by Jakub Klinkovský's avatar Jakub Klinkovský Committed by Tomáš Oberhuber
Browse files

Added missing CUDA support checks

parent 5c693b33
No related branches found
No related tags found
1 merge request!58To/matrices
...@@ -33,6 +33,8 @@ setElement( Element* data, ...@@ -33,6 +33,8 @@ setElement( Element* data,
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
cudaMemcpy( ( void* ) data, ( void* ) &value, sizeof( Element ), cudaMemcpyHostToDevice ); cudaMemcpy( ( void* ) data, ( void* ) &value, sizeof( Element ), cudaMemcpyHostToDevice );
TNL_CHECK_CUDA_DEVICE; TNL_CHECK_CUDA_DEVICE;
#else
throw Exceptions::CudaSupportMissing();
#endif #endif
// TODO: For some reason the following does not work after adding // TODO: For some reason the following does not work after adding
// #ifdef __CUDA_ARCH__ to Array::setElement and ArrayView::setElement. // #ifdef __CUDA_ARCH__ to Array::setElement and ArrayView::setElement.
...@@ -51,6 +53,8 @@ getElement( const Element* data ) ...@@ -51,6 +53,8 @@ getElement( const Element* data )
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
cudaMemcpy( ( void* ) &result, ( void* ) data, sizeof( Element ), cudaMemcpyDeviceToHost ); cudaMemcpy( ( void* ) &result, ( void* ) data, sizeof( Element ), cudaMemcpyDeviceToHost );
TNL_CHECK_CUDA_DEVICE; TNL_CHECK_CUDA_DEVICE;
#else
throw Exceptions::CudaSupportMissing();
#endif #endif
// TODO: For some reason the following does not work after adding // TODO: For some reason the following does not work after adding
// #ifdef __CUDA_ARCH__ to Array::getElement and ArrayView::getElement // #ifdef __CUDA_ARCH__ to Array::getElement and ArrayView::getElement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment