Page MenuHomePhabricator
Feed Advanced Search

Wed, Jan 13

rgreenblatt added a comment to D94337: Add cuda header type for cuh files.
In D94337#2496329, @tra wrote:

We were talking about the case where clang can't expand CUDA-specific macros.

Somehow I totally forgot about or missed this context.

Wed, Jan 13, 12:56 PM · Restricted Project

Mon, Jan 11

rgreenblatt added a comment to D94337: Add cuda header type for cuh files.
In D94337#2491825, @tra wrote:

'Works' is not exactly the same as 'works correctly'. This example makes a() look like a regular host function, instead of the kernel, and that affects how the rest of the TU get parsed.
I.e. you'll have further errors if somewhere down below the file has a<<<1,1>>>(). Similar story with ignoring __host__ and __device__ attributes -- that may lead to various overload resolution errors, or reporting conflicting redeclarations/redefinitions for the perfectly valid host/device function overloads. The list goes on.

Mon, Jan 11, 11:04 PM · Restricted Project
rgreenblatt updated the diff for D94337: Add cuda header type for cuh files.

Added CUDAHeader_DEVICE to propery handle split compilation

Mon, Jan 11, 8:31 PM · Restricted Project
rgreenblatt added a comment to D94337: Add cuda header type for cuh files.
In D94337#2491515, @tra wrote:

Does it make sense?

Yep, most of what your saying makes sense to me. Thanks for taking the time to review this.

Mon, Jan 11, 5:09 PM · Restricted Project
rgreenblatt added a comment to D94337: Add cuda header type for cuh files.
In D94337#2490828, @tra wrote:

The problem is that just telling compiler that the header is a CUDA source is not sufficient. Clang relies on a lot of CUDA SDK headers in order to make the standard CUDA things like __host__, 'device', threadIdx, etc work. For the CUDA source files clang pre-includes a lot of headers. I'm not quite sure what clang would be supposed to do when it's given a .cuh as an input. If we pre-include the CUDA headers as we do for .cu compilation, we'll get way more of the preprocessed output than the user would likely expect. If we do not pre-include CUDA headers, we'll not get CUDA macros expanded and the output would not be suitable to pass on to the further compilation. On one hand it does not make things worse. On the other, it does not make them better, either. If anything, Clang not recognizing CUDA headers on their own is probably better than accepting them and producing invalid output.

Perhaps I'm missing something. Do you have specific use case in mind for this change?

Mon, Jan 11, 1:29 PM · Restricted Project

Sat, Jan 9

rgreenblatt added a comment to D94337: Add cuda header type for cuh files.

Just to be clear, this is currently a WIP - it would still be good if someone took a look at this because I don't know if
this approach makes any sense.

Sat, Jan 9, 8:23 PM · Restricted Project

Fri, Jan 8

rgreenblatt updated the diff for D94337: Add cuda header type for cuh files.

Fixed completion extension bug

Fri, Jan 8, 11:31 PM · Restricted Project
rgreenblatt updated the diff for D94337: Add cuda header type for cuh files.

Fused commits so CI passes???

Fri, Jan 8, 8:25 PM · Restricted Project
rgreenblatt abandoned D94349: Fix some missing applications of TY_CUDAHeader.

Oops didn't mean to open new revision.

Fri, Jan 8, 3:59 PM · Restricted Project
rgreenblatt updated the diff for D94337: Add cuda header type for cuh files.

Fixed some missing applications

Fri, Jan 8, 3:57 PM · Restricted Project
rgreenblatt requested review of D94349: Fix some missing applications of TY_CUDAHeader.
Fri, Jan 8, 3:55 PM · Restricted Project
rgreenblatt added a comment to D94337: Add cuda header type for cuh files.

I haven't added any tests for this change. This is my first commit, so I am not sure how to write a test or what tests are appropriate.

Fri, Jan 8, 1:17 PM · Restricted Project
rgreenblatt requested review of D94337: Add cuda header type for cuh files.
Fri, Jan 8, 1:15 PM · Restricted Project