Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Chudyk <mateuszchudyk@gmail.com>2019-07-19 19:20:18 +0300
committerMateusz Chudyk <mateuszchudyk@gmail.com>2019-07-19 19:20:18 +0300
commit87e51cd18a05f503d4f04709ac4121388b206c48 (patch)
treee7bce31f87e0bf7abbad76a5b83a3492cb64bf58 /callbacks/implementations.inl
parenta80efb933528ffbad8d17f7f7a915aeee1c3e0e7 (diff)
Add Writer callback
Diffstat (limited to 'callbacks/implementations.inl')
-rw-r--r--callbacks/implementations.inl16
1 files changed, 16 insertions, 0 deletions
diff --git a/callbacks/implementations.inl b/callbacks/implementations.inl
index 6e3a10f..773a5f8 100644
--- a/callbacks/implementations.inl
+++ b/callbacks/implementations.inl
@@ -53,6 +53,22 @@ public:
};
/*
+ * Write
+ */
+template <typename OutputBufferType>
+class CallbackImpl<CPUType::CPU_NAME, Write<OutputBufferType>> {
+public:
+ CPU_ATTR CallbackImpl(const Write<OutputBufferType>& config) : config(config) {}
+
+ CPU_ATTR void operator()(vi input, const OutputBufferInfo& info) {
+ kernels::write(input, config.addr, info.row_idx * info.cols + info.col_idx);
+ }
+
+private:
+ Write<OutputBufferType> config;
+};
+
+/*
* UnquantizeAndWrite
*/
template <> class CallbackImpl<CPUType::CPU_NAME, UnquantizeAndWrite> {