@@ -15,35 +15,30 @@ namespace onnxruntime {
15
15
16
16
namespace {
17
17
18
- ORT_FORCEINLINE double * OnlyCreateBufferIfMLFloat16 (double * p_output, int num_elems)
19
- {
18
+ ORT_FORCEINLINE double * OnlyCreateBufferIfMLFloat16 (double * p_output, int num_elems) {
20
19
return p_output;
21
20
}
22
21
23
- ORT_FORCEINLINE float * OnlyCreateBufferIfMLFloat16 (float * p_output, int num_elems)
24
- {
22
+ ORT_FORCEINLINE float * OnlyCreateBufferIfMLFloat16 (float * p_output, int num_elems) {
25
23
return p_output;
26
24
}
27
25
28
- ORT_FORCEINLINE float * OnlyCreateBufferIfMLFloat16 (MLFloat16* p_output, int num_elems)
29
- {
26
+ ORT_FORCEINLINE float * OnlyCreateBufferIfMLFloat16 (MLFloat16* p_output, int num_elems) {
30
27
return p_output == nullptr ? nullptr : new float [num_elems];
31
28
}
32
29
33
30
34
31
template <typename T>
35
- ORT_FORCEINLINE std::shared_ptr<std::vector<float >> ConvertMLFloat16ToFloatBufferIfNeeded (const T* p_input, int num_elems);
32
+ ORT_FORCEINLINE std::shared_ptr<std::vector<float >> ConvertMLFloat16ToFloatBufferIfNeeded (const T* p_input, int64_t num_elems);
36
33
37
34
template <typename T>
38
35
ORT_FORCEINLINE std::shared_ptr<std::vector<float >> ConvertMLFloat16ToFloatBufferIfNeeded (
39
- const std::enable_if_t <std::is_same_v<T, float > || std::is_same_v<T, double >, T>* p_input, int num_elems)
40
- {
36
+ const std::enable_if_t <std::is_same_v<T, float > || std::is_same_v<T, double >, T>* p_input, int64_t num_elems) {
41
37
return nullptr ;
42
38
}
43
39
44
40
template <>
45
- std::shared_ptr<std::vector<float >> ConvertMLFloat16ToFloatBufferIfNeeded<MLFloat16>(const MLFloat16* p_input, int num_elems)
46
- {
41
+ std::shared_ptr<std::vector<float >> ConvertMLFloat16ToFloatBufferIfNeeded<MLFloat16>(const MLFloat16* p_input, int64_t num_elems) {
47
42
if (!p_input) {
48
43
return nullptr ;
49
44
}
@@ -56,8 +51,7 @@ std::shared_ptr<std::vector<float>> ConvertMLFloat16ToFloatBufferIfNeeded<MLFloa
56
51
}
57
52
58
53
59
- void ConvertFloatBufferToMLFloat16 (const float * output_buffer, MLFloat16* p_output, int num_elems)
60
- {
54
+ void ConvertFloatBufferToMLFloat16 (const float * output_buffer, MLFloat16* p_output, int64_t num_elems) {
61
55
if (!output_buffer || !p_output) {
62
56
return ;
63
57
}
0 commit comments