Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
2lut_op.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 #include <string>
19 #include <vector>
20 
21 #include "tc/c2/tc_op.h"
22 #include "tc/library/2lut.h"
23 
24 namespace caffe2 {
25 
26 template <
27  typename T,
28  typename I,
29  class Context,
30  class Engine = caffe2::DefaultEngine>
31 class Tc2LUTOp : public TcOp<T, Context, Engine> {
32  public:
33  static constexpr auto description = tc::TC_2LUT;
34 
35  Tc2LUTOp(const caffe2::OperatorDef& operator_def, caffe2::Workspace* ws)
36  : TcOp<T, Context, Engine>(operator_def, ws) {
37  this->tc_ = tc::TC_2LUT;
38  this->tcName_ = tc::TC_2LUT_NAME;
39  }
40 
41  ~Tc2LUTOp() override {}
42 
43  protected:
44  void setupNaiveMappingOptions() override {
45  this->mappingOptions_.mapToBlocks(256)
46  .mapToThreads(64)
47  .tile({1})
48  .unroll(1)
49  .useSharedMemory(false)
50  .usePrivateMemory(false);
51  }
52 };
53 } // namespace caffe2
tc::MappingOptions mappingOptions_
Definition: tc_op.h:133
MappingOptions & mapToThreads(std::initializer_list< uint64_t > threads)
Definition: mapping_options-inl.h:273
MappingOptions & usePrivateMemory(bool b)
Definition: mapping_options-inl.h:331
MappingOptions & useSharedMemory(bool b)
Definition: mapping_options-inl.h:326
Definition: tc_op.h:36
MappingOptions & mapToBlocks(std::initializer_list< uint64_t > blocks)
Definition: mapping_options-inl.h:297
std::string tc_
Definition: tc_op.h:128
std::string tcName_
Definition: tc_op.h:130
void setupNaiveMappingOptions() override
Definition: 2lut_op.h:44
MappingOptions & tile(const std::vector< uint64_t > &sizes)
Definition: mapping_options-inl.h:251
static constexpr auto description
Definition: 2lut_op.h:33
~Tc2LUTOp() override
Definition: 2lut_op.h:41
Tc2LUTOp(const caffe2::OperatorDef &operator_def, caffe2::Workspace *ws)
Definition: 2lut_op.h:35
Definition: 2lut_op.h:31