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

github.com/marian-nmt/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-09 17:27:46 +0300
committerMateusz Chudyk <mateuszchudyk@gmail.com>2019-07-09 22:39:50 +0300
commit1115cc6c3e65115bd5a36c9615bc20186a5a0746 (patch)
tree0146862dc8ecaa13f859ae00de428e1f7d179804
parentab876d8d42687fb1ccc1dc2eecd0abb8e9e7cd99 (diff)
Add Write kernel for others vector types
-rw-r--r--kernels/implementations.inl18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernels/implementations.inl b/kernels/implementations.inl
index 2c14429..7e0641d 100644
--- a/kernels/implementations.inl
+++ b/kernels/implementations.inl
@@ -34,6 +34,15 @@ namespace kernels {
/*
* Write
*/
+CPU_ATTR static inline void write(vi input, int* output, Index offset) {
+ *reinterpret_cast<vi*>(output + offset) = input;
+}
+
+CPU_ATTR static inline void write(dvi input, int* output, Index offset) {
+ write(input.first, output, offset);
+ write(input.second, output, offset + sizeof(dvi::type) / 4);
+}
+
CPU_ATTR static inline void write(vf input, float* output, Index offset) {
*reinterpret_cast<vf*>(output + offset) = input;
}
@@ -43,6 +52,15 @@ CPU_ATTR static inline void write(dvf input, float* output, Index offset) {
write(input.second, output, offset + sizeof(dvf::type) / 4);
}
+CPU_ATTR static inline void write(vd input, double* output, Index offset) {
+ *reinterpret_cast<vd*>(output + offset) = input;
+}
+
+CPU_ATTR static inline void write(dvd input, double* output, Index offset) {
+ write(input.first, output, offset);
+ write(input.second, output, offset + sizeof(dvd::type) / 8);
+}
+
/*
* Quantize
*/