-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major Changes + `pressio_dtype_from_type` api made public Bug Fix + Added documentation to printer functions
- Loading branch information
Showing
5 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <pressio_dtype.h> | ||
|
||
/** | ||
* Convert types to pressio_dtypes | ||
* | ||
* \tparam T the type to identify | ||
* \returns which pressio_dtype corresponds to the type T. | ||
*/ | ||
template <class T> | ||
constexpr pressio_dtype pressio_dtype_from_type() { | ||
return (std::is_same<T, double>::value ? pressio_double_dtype : | ||
std::is_same<T, float>::value ? pressio_float_dtype : | ||
std::is_same<T, int64_t>::value ? pressio_int64_dtype : | ||
std::is_same<T, int32_t>::value ? pressio_int32_dtype : | ||
std::is_same<T, int16_t>::value ? pressio_int16_dtype : | ||
std::is_same<T, int8_t>::value ? pressio_int8_dtype : | ||
std::is_same<T, uint64_t>::value ? pressio_uint64_dtype : | ||
std::is_same<T, uint32_t>::value ? pressio_uint32_dtype : | ||
std::is_same<T, uint16_t>::value ? pressio_uint16_dtype : | ||
std::is_same<T, uint8_t>::value ? pressio_uint8_dtype : | ||
pressio_byte_dtype | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters