"research/adversarial_text/layers.py" did not exist on "b5afddbefe9d27d368ace5ed9430290d9be41d8e"
thread_group.hpp 422 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
2
3
4
5
6
#pragma once
#include "get_id.hpp"

namespace ck {

template <index_t ThreadPerBlock>
Chao Liu's avatar
Chao Liu committed
7
struct ThisThreadBlock
Chao Liu's avatar
Chao Liu committed
8
9
10
11
12
13
14
15
16
17
18
{
    static constexpr index_t kNumThread_ = ThreadPerBlock;

    __device__ static constexpr index_t GetNumOfThread() { return kNumThread_; }

    __device__ static constexpr bool IsBelong() { return true; }

    __device__ static index_t GetThreadId() { return get_thread_local_1d_id(); }
};

} // namespace ck