cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
322 stars 92 forks source link

[API] Add bitcast API #330

Closed zzzDavid closed 3 years ago

zzzDavid commented 3 years ago

This pull request is linked to issue #310.

Description

Adding support for bitcast in python/heterocl/compute_api.py: heterocl.bitcast() corresponding test: tests/test_api_bitcast.py

zzzDavid commented 3 years ago

@seanlatias Hi, I rebased and re-implemented bitcast API with compute, also added support for bitcasting expression. Please review the changes, thanks!

seanlatias commented 3 years ago

Also, for the expression one, actually, I mean something like this.

a = # some hcl expression
b = hcl.bitcast(a, dst_type) # b is still an expression, instead of a tensor

In other words, if the input is an expression, return an expression.

seanlatias commented 3 years ago

@zzzDavid if you have time can you fix this? It shouldn't take too much time. Thanks.

zzzDavid commented 3 years ago

@zzzDavid if you have time can you fix this? It shouldn't take too much time. Thanks.

Should have fixed that sooner, thanks for reminding me. Please review my lastest commit :)