synchronization.hpp 361 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
2
#ifndef CK_SYNCHRONIZATION_AMD_HPP
#define CK_SYNCHRONIZATION_AMD_HPP
3
#ifndef CK_NOGPU
Chao Liu's avatar
Chao Liu committed
4
5
6
7
8
9
10

#include "config.hpp"

namespace ck {

__device__ void block_sync_lds()
{
11
#if CK_EXPERIMENTAL_BLOCK_SYNC_LDS_WITHOUT_SYNC_VMEM
Chao Liu's avatar
Chao Liu committed
12
13
14
15
16
    asm volatile("\
    s_waitcnt lgkmcnt(0) \n \
    s_barrier \
    " ::);
#else
17
    __syncthreads();
Chao Liu's avatar
Chao Liu committed
18
19
20
21
22
#endif
}

} // namespace ck
#endif
23
#endif