From 08dc7ad7d30d9c9f3da48275c70f660c619aee16 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Sun, 3 Jul 2016 00:00:18 -0600 Subject: [PATCH] added support for fp16 constant matricies --- src/backend.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend.cpp b/src/backend.cpp index 660cd72e..0010b787 100644 --- a/src/backend.cpp +++ b/src/backend.cpp @@ -1245,8 +1245,9 @@ struct ConstantMat : public likely_expression : (llvmType == likely_u16) ? ConstantDataArray::get(builder.module->context->context, ArrayRef((uint16_t*) &m->data, elements)) : (llvmType == likely_u32) ? ConstantDataArray::get(builder.module->context->context, ArrayRef((uint32_t*) &m->data, elements)) : (llvmType == likely_u64) ? ConstantDataArray::get(builder.module->context->context, ArrayRef((uint64_t*) &m->data, elements)) - : (llvmType == likely_f32) ? ConstantDataArray::get(builder.module->context->context, ArrayRef((float*) &m->data, elements)) - : ConstantDataArray::get(builder.module->context->context, ArrayRef((double*) &m->data, elements)) }; + : (llvmType == likely_f16) ? ConstantDataArray::getFP(builder.module->context->context, ArrayRef((uint16_t*) &m->data, elements)) + : (llvmType == likely_f32) ? ConstantDataArray::getFP(builder.module->context->context, ArrayRef((uint32_t*) &m->data, elements)) + : ConstantDataArray::getFP(builder.module->context->context, ArrayRef((uint64_t*) &m->data, elements)) }; Constant *const constantStruct = ConstantStruct::get(structType, values); stringstream name;