Adjust clang format to the new versions, revert broken macro layout (#714)

Αυτή η υποβολή περιλαμβάνεται σε:
Danylo Lytovchenko
2025-08-22 17:23:22 +02:00
υποβλήθηκε από GitHub
γονέας ed877433f3
υποβολή 2ff2316227
189 αρχεία άλλαξαν με 1906 προσθήκες και 2418 διαγραφές
@@ -67,8 +67,8 @@ hipMemoryType getMemoryType(const amd::Memory* memory) {
}
return ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) & memory->getMemFlags())
? hipMemoryTypeHost
: hipMemoryTypeDevice;
? hipMemoryTypeHost
: hipMemoryTypeDevice;
}
// ================================================================================================
@@ -336,8 +336,8 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
hip::getCurrentDevice()->SetActiveStatus();
size_t max_device_size = IS_LINUX
? dev_info.maxMemAllocSize_
: (dev_info.maxMemAllocSize_ + dev_info.maxPhysicalMemAllocSize_);
? dev_info.maxMemAllocSize_
: (dev_info.maxMemAllocSize_ + dev_info.maxPhysicalMemAllocSize_);
if ((useHostDevice && dev_info.maxPhysicalMemAllocSize_ < sizeBytes) ||
(!useHostDevice && max_device_size < sizeBytes)) {
@@ -401,9 +401,8 @@ hipError_t ihipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
}
if (flags == 0 ||
flags &
(hipHostMallocCoherent | hipHostMallocMapped | hipHostMallocNumaUser |
hipHostMallocUncached) ||
flags & (hipHostMallocCoherent | hipHostMallocMapped | hipHostMallocNumaUser |
hipHostMallocUncached) ||
(!(flags & hipHostMallocNonCoherent) && HIP_HOST_COHERENT)) {
ihipFlags |= CL_MEM_SVM_ATOMICS;
}
@@ -1143,7 +1142,7 @@ hipError_t ihipArrayCreate(hipArray_t* array, const HIP_ARRAY3D_DESCRIPTOR* pAll
return hipErrorInvalidValue;
}
unsigned int flags = hipArrayDefault | hipArrayLayered | hipArraySurfaceLoadStore |
hipArrayTextureGather; // hipArrayCubemap isn't supported
hipArrayTextureGather; // hipArrayCubemap isn't supported
if (pAllocateArray->Flags & (~flags)) {
return hipErrorInvalidValue;
}
@@ -1282,9 +1281,8 @@ hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) {
hipError_t ihipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags) {
if (hostPtr == nullptr || sizeBytes == 0 ||
flags &
~(hipHostRegisterPortable | hipHostRegisterMapped | hipExtHostRegisterCoarseGrained |
hipExtHostRegisterUncached)) {
flags & ~(hipHostRegisterPortable | hipHostRegisterMapped | hipExtHostRegisterCoarseGrained |
hipExtHostRegisterUncached)) {
return hipErrorInvalidValue;
} else {
unsigned int memFlags = CL_MEM_USE_HOST_PTR | CL_MEM_SVM_ATOMICS;
@@ -1377,9 +1375,8 @@ hipError_t hipHostAlloc(void** ptr, size_t sizeBytes, unsigned int flags) {
if (ptr == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
if (flags &
~(hipHostAllocPortable | hipHostAllocMapped | hipHostAllocWriteCombined |
hipHostAllocUncached)) {
if (flags & ~(hipHostAllocPortable | hipHostAllocMapped | hipHostAllocWriteCombined |
hipHostAllocUncached)) {
HIP_RETURN(hipErrorInvalidValue);
}
@@ -1868,9 +1865,9 @@ hipError_t ihipMemcpyHtoH(void* dstHost, const void* srcHost, amd::Coord3D copyR
for (size_t slice = 0; slice < copyRegion[2]; slice++) {
for (size_t row = 0; row < copyRegion[1]; row++) {
const void* srcRow = static_cast<const char*>(srcHost) + srcRect.start_ +
row * srcRect.rowPitch_ + slice * srcRect.slicePitch_;
row * srcRect.rowPitch_ + slice * srcRect.slicePitch_;
void* dstRow = static_cast<char*>(dstHost) + dstRect.start_ + row * dstRect.rowPitch_ +
slice * dstRect.slicePitch_;
slice * dstRect.slicePitch_;
std::memcpy(dstRow, srcRow, copyRegion[0]);
}
}
@@ -2331,9 +2328,8 @@ hipError_t ihipMemcpyParam3D(const HIP_MEMCPY3D* pCopy, hipStream_t stream, bool
// Transfers from device memory to pageable host memory and transfers from any
// host memory to any host memory are synchronous with respect to the host.
// Device to Device copies do not need to host side synchronization.
if (dstMemoryType == hipMemoryTypeHost ||
((pCopy->srcMemoryType == hipMemoryTypeHost) &&
(pCopy->dstMemoryType == hipMemoryTypeHost))) {
if (dstMemoryType == hipMemoryTypeHost || ((pCopy->srcMemoryType == hipMemoryTypeHost) &&
(pCopy->dstMemoryType == hipMemoryTypeHost))) {
isAsync = false;
} else if ((pCopy->srcMemoryType == hipMemoryTypeDevice) &&
(pCopy->dstMemoryType == hipMemoryTypeDevice)) {
@@ -4111,7 +4107,7 @@ hipError_t ihipMipmapArrayCreate(hipMipmappedArray_t* mipmapped_array_pptr,
return hipErrorInvalidValue;
}
unsigned int flags = hipArrayDefault | hipArrayLayered | hipArraySurfaceLoadStore |
hipArrayTextureGather; // hipArrayCubemap isn't supported
hipArrayTextureGather; // hipArrayCubemap isn't supported
if (mipmapped_array_desc_ptr->Flags & (~flags)) {
return hipErrorInvalidValue;
}