| 27 | namespace cl { |
| 28 | |
| 29 | class Softmax : public GPUOperation { |
| 30 | public: |
| 31 | Softmax() = default; |
| 32 | explicit Softmax(const OperationDef& definition) : GPUOperation(definition) {} |
| 33 | Status AddToQueue(CLCommandQueue* queue) override; |
| 34 | Status Tune(const TuningParameters& params) override; |
| 35 | |
| 36 | Status Compile(const CreationContext& creation_context) override; |
| 37 | |
| 38 | // Move only |
| 39 | Softmax(Softmax&& kernel); |
| 40 | Softmax& operator=(Softmax&& kernel); |
| 41 | Softmax(const Softmax&) = delete; |
| 42 | Softmax& operator=(const Softmax&) = delete; |
| 43 | |
| 44 | friend Softmax CreateSoftmax(); |
| 45 | |
| 46 | private: |
| 47 | Status BindArguments(); |
| 48 | int3 GetGridSize() const; |
| 49 | CLKernel kernel_; |
| 50 | int3 work_group_size_ = int3(8, 4, 1); |
| 51 | }; |
| 52 | |
| 53 | Softmax CreateSoftmax(const OperationDef& definition); |
| 54 | |