Skip to content

Commit

Permalink
added support for fp16 constant matricies
Browse files Browse the repository at this point in the history
  • Loading branch information
jklontz committed Jul 3, 2016
1 parent 338e614 commit 08dc7ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend.cpp
Expand Up @@ -1245,8 +1245,9 @@ struct ConstantMat : public likely_expression
: (llvmType == likely_u16) ? ConstantDataArray::get(builder.module->context->context, ArrayRef<uint16_t>((uint16_t*) &m->data, elements))
: (llvmType == likely_u32) ? ConstantDataArray::get(builder.module->context->context, ArrayRef<uint32_t>((uint32_t*) &m->data, elements))
: (llvmType == likely_u64) ? ConstantDataArray::get(builder.module->context->context, ArrayRef<uint64_t>((uint64_t*) &m->data, elements))
: (llvmType == likely_f32) ? ConstantDataArray::get(builder.module->context->context, ArrayRef<float >((float*) &m->data, elements))
: ConstantDataArray::get(builder.module->context->context, ArrayRef<double >((double*) &m->data, elements)) };
: (llvmType == likely_f16) ? ConstantDataArray::getFP(builder.module->context->context, ArrayRef<uint16_t>((uint16_t*) &m->data, elements))
: (llvmType == likely_f32) ? ConstantDataArray::getFP(builder.module->context->context, ArrayRef<uint32_t>((uint32_t*) &m->data, elements))
: ConstantDataArray::getFP(builder.module->context->context, ArrayRef<uint64_t>((uint64_t*) &m->data, elements)) };
Constant *const constantStruct = ConstantStruct::get(structType, values);

stringstream name;
Expand Down

0 comments on commit 08dc7ad

Please sign in to comment.