Skip to content
Snippets Groups Projects

Fix for bad host code generation for CTarget and more cleanup

Merged Nick Curtis requested to merge arghdos/loopy:c_execution into master

Sorry for the continued minor updates (hopefully this will be the last of them!)

This PR does two things:

  1. Only return a (non-DummyHost) CASTBuilder in the ExecutableCTarget -- this fixes host-code being generated for targets it has no business in doing so, e.g., for the OpenCLTarget
  2. Change get_function_definition in the CASTBuilder such that global temporaries are only included in the function definition for device code -- currently, it would place the same temporary in both host and device code leading to a compilation error -- to that end, I've included a test that checks for this.
  3. Some more minor cleanup (6c7648ab, 2bc2dc14, 70dc2d63)

AFAIK, # 2 only affects CTarget, ExecutableCTarget and the ISPCTarget, as all other targets define their own get_function_definition -- and all of these should only define global temporaries once (at the first device program)

I think this is a reasonable update, but I'm just starting to feel more confident in my understanding of host-code generation, so please point out any better ways to do this or other issues!

Nick

Edited by Nick Curtis

Merge request reports

Pipeline #9630 passed

Pipeline passed for 5898b88a on arghdos:c_execution

Merged by Andreas KlöcknerAndreas Klöckner 7 years ago (Dec 5, 2017 5:23am UTC)

Loading

Pipeline #9639 passed

Pipeline passed for 7c3e8334 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading