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

calling cuda()/nvvm() functions with empty body triggers assertion… #11

Closed
michael-kenzel opened this issue Aug 16, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@michael-kenzel
Copy link
Contributor

michael-kenzel commented Aug 16, 2022

…when called from exported function if there is a variable in scope that is initialized to a different lambda depending on function parameter.

repro:

#[import(cc = "thorin")] fn nvvm(_dev: i32, _grid: (i32, i32, i32), _block: (i32, i32, i32), _body: fn() -> ()) -> ();

#[export]
fn test(b: bool) -> () {
	let fun = if b { @||{} } else { @||{} };

	nvvm(0, (1, 1, 1), (1, 1, 1), @||{});
}

results in

src/thorin/be/codegen.cpp:39: thorin::get_kernel_configs(thorin::Importer&, const std::vector<thorin::Continuation*>&, thorin::Cont2Config&, std::function<std::unique_ptr<thorin::KernelConfig>(thorin::Continuation*, thorin::Continuation*)>)::<lambda(thorin::Continuation*)>: Assertion `p.second && "single kernel config entry expected"' failed.

when compiled with --emit-llvm

@michael-kenzel michael-kenzel added the bug Something isn't working label Aug 16, 2022
@michael-kenzel
Copy link
Contributor Author

michael-kenzel commented Aug 16, 2022

just realized that this is actually a thorin problem so I opened an issue there…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant