Skip to content

Commit

Permalink
SGVector/Matrix gpu checks should be inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed May 17, 2018
1 parent bd69a3b commit fb66888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/shogun/lib/SGMatrix.h
Expand Up @@ -76,7 +76,7 @@ template<class T> class SGMatrix : public SGReferencedData
*
* @return true if matrix is on GPU
*/
bool on_gpu() const
SG_FORCED_INLINE bool on_gpu() const
{
return gpu_ptr != NULL;
}
Expand Down Expand Up @@ -474,7 +474,7 @@ template<class T> class SGMatrix : public SGReferencedData
/** Assert whether the data is on GPU
* and raise error if the data is on GPU
*/
void assert_on_cpu() const
SG_FORCED_INLINE void assert_on_cpu() const
{
if (on_gpu())
SG_SERROR("Direct memory access not possible when data is in GPU memory.\n");
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/lib/SGVector.h
Expand Up @@ -83,7 +83,7 @@ template<class T> class SGVector : public SGReferencedData
*
* @return true if vector is on GPU
*/
bool on_gpu() const
SG_FORCED_INLINE bool on_gpu() const
{
return gpu_ptr != NULL;
}
Expand Down Expand Up @@ -573,7 +573,7 @@ template<class T> class SGVector : public SGReferencedData
/** Assert whether the data is on GPU
* and raise error if the data is on GPU
*/
void assert_on_cpu() const
SG_FORCED_INLINE void assert_on_cpu() const
{
if (on_gpu())
SG_SERROR("Direct memory access not possible when data is in GPU memory.\n");
Expand Down

0 comments on commit fb66888

Please sign in to comment.