synchronization.hpp 272 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
#pragma once
Chao Liu's avatar
Chao Liu committed
2

Chao Liu's avatar
Chao Liu committed
3
#include "ck/ck.hpp"
Chao Liu's avatar
Chao Liu committed
4
5
6
7
8

namespace ck {

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

} // namespace ck