BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
blackcat
streams
stream_synchronization.h
Go to the documentation of this file.
1
/*
2
* Stream_Synchronization.h
3
*
4
* Created on: Dec 16, 2019
5
* Author: joseph
6
*/
7
8
#ifndef BLACKCAT_STREAM_SYNCHRONIZATION_H_
9
#define BLACKCAT_STREAM_SYNCHRONIZATION_H_
10
11
#include "../common.h"
12
13
namespace
bc
{
14
namespace
streams {
15
16
inline
void
host_sync
() {
17
BC_omp_bar__
18
}
19
20
inline
void
device_sync
() {
21
BC_IF_CUDA
(cudaDeviceSynchronize();)
22
}
23
24
inline
void
synchronize
() {
25
host_sync
();
26
device_sync
();
27
}
28
29
}
30
}
31
32
33
34
35
#endif
/* STREAM_SYNCHRONIZATION_H_ */
bc::streams::host_sync
void host_sync()
Definition:
stream_synchronization.h:16
bc::streams::device_sync
void device_sync()
Definition:
stream_synchronization.h:20
BC_IF_CUDA
#define BC_IF_CUDA(...)
Definition:
common.h:68
bc::streams::synchronize
void synchronize()
Definition:
stream_synchronization.h:24
BC_omp_bar__
#define BC_omp_bar__
Definition:
common.h:270
bc
The Evaluator determines if an expression needs to be greedily optimized.
Definition:
algorithms.h:22
Generated by
1.8.13