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

#include "config.hpp"

namespace ck {

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

} // namespace ck
#endif