This is an archive of the discontinued LLVM Phabricator instance.

Initialise workFn to zero explicitly
AbandonedPublic

Authored by JonChesterfield on Oct 2 2019, 6:15 PM.

Details

Summary

Initialise workFn to zero explicitly

It may be implicitly zero initialised by some toolchains.
This change would remove an out of tree patch for amdgcn.

Event Timeline

JonChesterfield created this revision.Oct 2 2019, 6:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 6:15 PM

Tiny change ofc. I'm looking through the diff between in tree nvptx and out of tree amdgcn and this stuck out.

Why do we need this?

I think it needs to be initialized to zero to handle the case where there is no work, though I'm not the original author of the patch.

Iirc cuda/nvcc will implicitly zero initialize this and hip/clang does not.

I think it needs to be initialized to zero to handle the case where there is no work, though I'm not the original author of the patch.

Iirc cuda/nvcc will implicitly zero initialize this and hip/clang does not.

cuda does not initialize it to zero. If there is no work, __kmpc_kernel_deinit will set it to 0 and terminate the workers.

JonChesterfield abandoned this revision.Oct 3 2019, 9:23 AM

Interesting. I'll have to put more thought into this, thanks.