This is an archive of the discontinued LLVM Phabricator instance.

[GPGPU] Do not create copy statements when targetting managed memory
ClosedPublic

Authored by grosser on Aug 18 2017, 3:49 AM.

Event Timeline

grosser created this revision.Aug 18 2017, 3:49 AM
bollu accepted this revision.Aug 18 2017, 4:51 AM

LGTM

lib/CodeGen/PPCGCodeGeneration.cpp
3143

Consider either:

Schedule = map_to_device(PPCGGen, Schedule, /*to_from_device=*/ !PollyManagedMemory);

or

const bool CreateTransferToFromDevice = !PollyManagedMemory;
Schedule = map_to_device(PPCGGen, Schedule, CreateTransferToFromDevice);
lib/External/ppcg/gpu.c
5280

Could you please document why this is necessary in the comment above?

5683

Personal opinion: I don't like magic constants. Consider:

const int create_transfer_to_from_device = 1;
schedule = map_to_device(gen, schedule, create_transfer_to_from_device);

or something along those lines.

This revision is now accepted and ready to land.Aug 18 2017, 4:51 AM

Thanks for the comments. Will address them and commit.

This revision was automatically updated to reflect the committed changes.