@@ -569,14 +569,11 @@ bool CIRGenModule::shouldEmitCUDAGlobalVar(const VarDecl *global) const {
569
569
// size and host-side address in order to provide access to
570
570
// their device-side incarnations.
571
571
572
- if (global->getType ()->isCUDADeviceBuiltinTextureType ()) {
573
- llvm_unreachable (" NYI" );
574
- }
575
-
576
572
return !langOpts.CUDAIsDevice || global->hasAttr <CUDADeviceAttr>() ||
577
573
global->hasAttr <CUDAConstantAttr>() ||
578
574
global->hasAttr <CUDASharedAttr>() ||
579
- global->getType ()->isCUDADeviceBuiltinSurfaceType ();
575
+ global->getType ()->isCUDADeviceBuiltinSurfaceType () ||
576
+ global->getType ()->isCUDADeviceBuiltinTextureType ();
580
577
}
581
578
582
579
void CIRGenModule::emitGlobal (GlobalDecl gd) {
@@ -1212,7 +1209,6 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
1212
1209
// initializer.
1213
1210
if (gv.isDeclaration ()) {
1214
1211
getTargetCIRGenInfo ().setTargetAttributes (d, gv, *this );
1215
-
1216
1212
// External HIP managed variables needed to be recorded for transformation
1217
1213
// in both device and host compilations.
1218
1214
if (getLangOpts ().CUDA && d && d->hasAttr <HIPManagedAttr>() &&
@@ -1493,7 +1489,8 @@ void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *d,
1493
1489
// because they must not be initialized.
1494
1490
if (linkage != cir::GlobalLinkageKind::InternalLinkage &&
1495
1491
(d->hasAttr <CUDADeviceAttr>() || d->hasAttr <CUDAConstantAttr>() ||
1496
- d->getType ()->isCUDADeviceBuiltinSurfaceType ())) {
1492
+ d->getType ()->isCUDADeviceBuiltinSurfaceType () ||
1493
+ d->getType ()->isCUDADeviceBuiltinTextureType ())) {
1497
1494
gv->setAttr (CUDAExternallyInitializedAttr::getMnemonic (),
1498
1495
CUDAExternallyInitializedAttr::get (&getMLIRContext ()));
1499
1496
}
0 commit comments