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

[CODEGEN NVPTX] Initialize llvm before lookup for the target #2683

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

denis0x0D
Copy link
Contributor

@denis0x0D denis0x0D commented Feb 27, 2019

LLVMTargetInfo, TargetMachine and so on should be initialized before lookup for the specific target.

 n = tvm.var ("n")
 A = tvm.placeholder ((n ,n), name='A', dtype="float32")
 B = tvm.placeholder ((n, n), name='B', dtype="float32")
 C = tvm.compute (A.shape, lambda *i: A(*i) + B(*i), name='C')
 s = tvm.create_schedule (C.op)

 bx, tx = s[C].split (C.op.axis[0], factor=64)
 s[C].bind (bx, tvm.thread_axis("blockIdx.x"))
 s[C].bind (tx, tvm.thread_axis("threadIdx.x"))
 module = tvm.build(s, [A, B, C], "nvptx", target_host="llvm")

This code fails with error:
Unable to find target for this triple (no targets are registered) target_triple=nvptx64_nvidia_cuda

@masahi
Copy link
Member

masahi commented Feb 27, 2019

can you also update AMDGPU codegen here? I remember being puzzled by this error when target_host="llvm" is explicitly passed.

@denis0x0D
Copy link
Contributor Author

Ok, I see the same problem for AMD GPU codegen.

@masahi masahi merged commit 2bf3458 into apache:master Feb 27, 2019
@masahi
Copy link
Member

masahi commented Feb 27, 2019

thanks @denis0x0D this is merged.

@yzhliu yzhliu mentioned this pull request Mar 2, 2019
28 tasks
bwasti pushed a commit to facebookexperimental/tvm that referenced this pull request Mar 6, 2019
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.

2 participants