Skip to content

Commit 4ff18a5

Browse files
authored
Add kDLBComplex type to DLDataTypeCode (#187)
* Add kDLBComplex type to DLDataTypeCode * Rename to kDLBcomplex (lowercase c)
1 parent 2e27af8 commit 4ff18a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/dlpack/dlpack.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ typedef enum {
179179
* while the consumer must stop importing if the value is unexpected.
180180
*/
181181
kDLFloat4_e2m1fn = 17U,
182+
/*! \brief complex number (2x bfloat16)
183+
* (C/C++/Python layout: same as kDLComplex, compact struct per complex number)
184+
*/
185+
kDLBcomplex = 18U,
182186
} DLDataTypeCode;
183187

184188
/*!
@@ -191,6 +195,8 @@ typedef enum {
191195
* - float4(vectorized 4 float): type_code = 2, bits = 32, lanes = 4
192196
* - int8: type_code = 0, bits = 8, lanes = 1
193197
* - std::complex<float>: type_code = 5, bits = 64, lanes = 1
198+
* - std::complex<std::float16_t>: type_code = 5, bits = 32, lanes = 1
199+
* - std::complex<std::bfloat16_t>: type_code = 18, bits = 32, lanes = 1
194200
* - bool: type_code = 6, bits = 8, lanes = 1 (as per common array library convention, the underlying storage size of bool is 8 bits)
195201
* - float8_e4m3: type_code = 8, bits = 8, lanes = 1 (packed in memory)
196202
* - float6_e3m2fn: type_code = 16, bits = 6, lanes = 1 (packed in memory)

0 commit comments

Comments
 (0)