File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
include/mlir/Dialect/LLVMIR Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,15 @@ namespace NVVM {
2424// Structure to store and check compatibility of SM versions.
2525struct NVVMCheckSMVersion {
2626 int archVersion;
27+
28+ // true if the SM version is accelerated (Ex. sm_90a vs sm_90)
2729 bool archAccelerated;
28- bool exactMatch;
30+
31+ // true if the target SM version must exactly match this one
32+ // (both archVersion and archAccelerated)
33+ // Ex. sm_90a with exactMatch = false will also match with
34+ // sm_100a, sm_120a, etc...
35+ bool exactMatch;
2936
3037 NVVMCheckSMVersion ()
3138 : archVersion(0 ), archAccelerated(false ), exactMatch(false ) {}
Original file line number Diff line number Diff line change @@ -1738,14 +1738,16 @@ LogicalResult NVVMTargetAttr::verifyTarget(Operation *gpuModule) {
17381738 return success ();
17391739
17401740 auto gpuModuleOp = llvm::dyn_cast<gpu::GPUModuleOp>(gpuModule);
1741- if (!gpuModuleOp)
1741+ if (!gpuModuleOp) {
17421742 return emitError (gpuModule->getLoc (),
17431743 " NVVM target attribute must be attached to a GPU module" );
1744+ }
17441745
17451746 NVVMCheckSMVersion targetSMVersion (getChip ());
1746- if (targetSMVersion.archVersion < 20 )
1747+ if (targetSMVersion.archVersion < 20 ) {
17471748 return emitError (gpuModule->getLoc (),
17481749 " Minimum NVVM target SM version is sm_20" );
1750+ }
17491751
17501752 gpuModuleOp->walk ([&](Operation *op) {
17511753 if (auto reqOp = llvm::dyn_cast<NVVM::RequiresSMInterface>(op)) {
You can’t perform that action at this time.
0 commit comments