Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] s[op].bind for block & thread binding for OpenCL/CUDA targets #448

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hecmay
Copy link
Collaborator

@hecmay hecmay commented Apr 8, 2022

TBA

@hecmay hecmay changed the title [API] s[op].bind for block an thread axis binding for OpenCL/CUDA targets [API] s[op].bind for block & thread binding for OpenCL/CUDA targets Apr 8, 2022
@hecmay
Copy link
Collaborator Author

hecmay commented Apr 8, 2022

vector-add example to map loops after hcl.split to specific thread and block axes

    def kernel(A, B):
        C = hcl.compute((256,), lambda i: A[i] + B[i], "C")
        return C

    bx, tx = s[kernel.C].split(kernel.C.axis[0], factor=64)
    s[kernel.C].bind(bx, hcl.BlockIdx.x)
    s[kernel.C].bind(tx, hcl.ThreadIdx.x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant