[PATCH] D56318: [HIP] Fix size_t for MSVC environment

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 4 10:50:17 PST 2019


yaxunl added a comment.

In D56318#1346456 <https://reviews.llvm.org/D56318#1346456>, @rjmccall wrote:

> What's the general idea here, that you're going to pretend to be the environment's "standard" CPU target of the right pointer width and try to match the ABI exactly?  This seems like a pretty treacherous road to go down.


The pointer width does not change. In both case it is 64 bit. The only difference is that MSVC uses unsigned long long as size_t whereas by default AMDGPU uses unsigned long as size_t. They have the same size but in AST they are different type. When HIP is compiled in MSVC environment, it has to use header files of MSVC. This nominal difference in size_t definition causes compilation error since MSVC header files contains typedef of size_t as unsigned long long. Since we cannot change header files of MSVC, we have to change our own size_t definition.

We do not want to change our device ABI.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56318/new/

https://reviews.llvm.org/D56318





More information about the cfe-commits mailing list