@@ -298,15 +298,15 @@ void TypeInDeclRule::registerMatcher(MatchFinder &MF) {
298
298
" dim3" , " cudaError" , " curandStatus" , " cublasStatus" , " CUstream" ,
299
299
" CUstream_st" , " thrust::complex" , " thrust::device_vector" ,
300
300
" thrust::device_ptr" , " thrust::device_reference" ,
301
- " thrust::host_vector" , " cublasHandle_t" , " CUevent_st" , " __half " ,
302
- " half " , " __half2 " , " half2 " , " cudaMemoryAdvise " , " cudaError_enum " ,
303
- " cudaDeviceProp " , " cudaStreamCaptureStatus " ,
304
- " cudaGraphExecUpdateResult " , " cudaPitchedPtr " ,
305
- " thrust::counting_iterator " , " thrust::transform_iterator " ,
306
- " thrust::permutation_iterator " , " thrust::iterator_difference " ,
307
- " cusolverDnHandle_t " , " cusolverDnParams_t " , " gesvdjInfo_t " ,
308
- " syevjInfo_t " , " thrust::device_malloc_allocator " ,
309
- " thrust::divides " , thrustNamespace () + " tuple" , " thrust::maximum" ,
301
+ " thrust::host_vector" , " cublasHandle_t" , " CUevent_st" ,
302
+ " cudaMemoryAdvise " , " cudaError_enum " , " cudaDeviceProp " ,
303
+ " cudaStreamCaptureStatus " , " cudaGraphExecUpdateResult " ,
304
+ " cudaPitchedPtr " , " thrust::counting_iterator " ,
305
+ " thrust::transform_iterator " , " thrust::permutation_iterator " ,
306
+ " thrust::iterator_difference " , " cusolverDnHandle_t " ,
307
+ " cusolverDnParams_t " , " gesvdjInfo_t " , " syevjInfo_t " ,
308
+ " thrust::device_malloc_allocator " , " thrust::divides " ,
309
+ thrustNamespace () + " tuple" , " thrust::maximum" ,
310
310
" thrust::multiplies" , " thrust::plus" , " cudaDataType_t" ,
311
311
" cudaError_t" , " CUresult" , " CUdevice" , " cudaEvent_t" ,
312
312
" cublasStatus_t" , " cuComplex" , " cuFloatComplex" ,
@@ -330,8 +330,7 @@ void TypeInDeclRule::registerMatcher(MatchFinder &MF) {
330
330
" cufftResult_t" , " cufftResult" , " cufftType_t" , " cufftType" ,
331
331
thrustNamespace () + " pair" , " CUdeviceptr" , " cudaDeviceAttr" ,
332
332
" CUmodule" , " CUjit_option" , " CUfunction" , " cudaMemcpyKind" ,
333
- " cudaComputeMode" , " __nv_bfloat16" ,
334
- " cooperative_groups::__v1::thread_group" ,
333
+ " cudaComputeMode" , " cooperative_groups::__v1::thread_group" ,
335
334
" cooperative_groups::__v1::thread_block" , " libraryPropertyType_t" ,
336
335
" libraryPropertyType" , " cudaDataType_t" , " cudaDataType" ,
337
336
" cublasComputeType_t" , " cublasAtomicsMode_t" , " cublasMath_t" ,
@@ -360,8 +359,8 @@ void TypeInDeclRule::registerMatcher(MatchFinder &MF) {
360
359
" cublasLtMatrixTransformDesc_t" , " cudaGraphicsMapFlags" ,
361
360
" cudaGraphicsRegisterFlags" , " cudaExternalMemoryHandleType" ,
362
361
" cudaExternalSemaphoreHandleType" , " CUstreamCallback" ,
363
- " cudaHostFn_t" , " __nv_half2 " , " __nv_half " , " cudaGraphNodeType " ,
364
- " CUsurfref " , " CUdevice_P2PAttribute" , " cudaIpcMemHandle_t" ))))))
362
+ " cudaHostFn_t" , " cudaGraphNodeType " , " CUsurfref " ,
363
+ " CUdevice_P2PAttribute" , " cudaIpcMemHandle_t" ))))))
365
364
.bind (" cudaTypeDef" ),
366
365
this );
367
366
@@ -1300,7 +1299,11 @@ void VectorTypeNamespaceRule::runRule(const MatchFinder::MatchResult &Result) {
1300
1299
if (!DpctGlobalInfo::isInCudaPath (RecDeclRepr->getBeginLoc ()))
1301
1300
return ;
1302
1301
}
1303
-
1302
+ auto TypePtr = TL->getTypePtr ();
1303
+ const auto *TT = dyn_cast<TypedefType>(TypePtr);
1304
+ if (TT && !isRedeclInCUDAHeader (TT)) {
1305
+ return ;
1306
+ }
1304
1307
auto BeginLoc =
1305
1308
getDefinitionRange (TL->getBeginLoc (), TL->getEndLoc ()).getBegin ();
1306
1309
0 commit comments