[cfe-dev] [RFC] Delayed target-specific diagnostic when compiling for the devices.

Alexey Bataev via cfe-dev cfe-dev at lists.llvm.org
Tue Jan 15 14:58:01 PST 2019


__host__ __device__ functions are still device functions and it means that they must be emitted when you compile for the device. You know, that the user marked those functions as the device functions. In OpenMP, you cannot say before the codegen phase whether the function is used on the device or not. We should not emit all the functions available, only those, which are used (implicitly or explicitly, directly or indirectly) in the target regions.

Best regards,
Alexey Bataev

>> 15 янв. 2019 г., в 17:34, John McCall <jmccall at apple.com> написал(а):
>> 
>> On 15 Jan 2019, at 17:20, Alexey Bataev wrote:
>> This is not only for asm, we need to delay all target-specific diagnostics.
>> I'm not saying that we need to move the host diagnostic, only the diagnostic for the device compilation.
>> As for Cuda, it is a little but different. In Cuda the programmer must explicitly mark the device functions,  while in OpenMP it must be done implicitly. Thus, we cannot reuse the solution used for Cuda.
> 
> All it means is that you can't just use the solution used for CUDA "off the shelf".  The basic idea of associating diagnostics with the current function and then emitting those diagnostics later when you realize that you have to emit that function is still completely applicable.
> 
> John.


More information about the cfe-dev mailing list