-
Hi all, Input<uint8_t> Input3{"Input3"};
void generate() {
Func5() = Input3;
} and Input<Buffer<float16_t>> Input3{"Input3"};
void generate() {
Func5() = Input3(x,y)[0][0];
} But writing like below failed: Input<float16_t> Input3{"Input3"};
void generate() {
Func5() = Input3;
} And it report error is:
Thank you in advance ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The issue with scalar float16 inputs is the ABI. We're not sure exactly how they should be passed on different platforms. Some ABIs put them in floating-point-specific registers, but in other cases Halide treats them as uint16s for passing them. For now you should just cast scalar float16 inputs to float32 on the C++ side and cast them back to float16 in the Halide code. |
Beta Was this translation helpful? Give feedback.
-
We can/should improve the compile time error message to make this answer
clearer. (Is there already an issue for this?)
…On Fri, Jun 24, 2022, 5:19 PM Andrew Adams ***@***.***> wrote:
The issue with scalar float16 inputs is the ABI. We're not sure exactly
how they should be passed on different platforms. Some ABIs put them in
floating-point-specific registers, but in other cases Halide treats them as
uint16s for passing them. For now you should just cast scalar float16
inputs to float32 on the C++ side and cast them back to float16 in the
Halide code.
—
Reply to this email directly, view it on GitHub
<#6812 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACQJ67SX7A3ASWGWQR3LKDVQXNY3ANCNFSM5ZWIESFQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
The issue with scalar float16 inputs is the ABI. We're not sure exactly how they should be passed on different platforms. Some ABIs put them in floating-point-specific registers, but in other cases Halide treats them as uint16s for passing them. For now you should just cast scalar float16 inputs to float32 on the C++ side and cast them back to float16 in the Halide code.