@@ -509,7 +509,7 @@ func.func @launch_cluster() {
509509// CHECK-NEXT: = memref.load %[[KERNEL_ARG1]][%[[TID]]] : memref<?xf32, 1>
510510
511511// -----
512- // This test tests the two optional attributes kernelModule and kernelFunc for gpu.launch
512+ // This test tests the two optional attributes `module` and `function` for gpu.launch
513513// CHECK-LABEL: func.func @testKernelAttributes()
514514// CHECK: gpu.launch_func @test_module::@test_kernel_func blocks in (%[[GRID_X:.*]], %[[GRID_Y:.*]], %[[GRID_Z:.*]]) threads in (%[[BLOCK_X:.*]], %[[BLOCK_Y:.*]], %[[BLOCK_Z:.*]])
515515// CHECK: gpu.module @test_module
@@ -523,15 +523,16 @@ func.func @testKernelAttributes() {
523523 %bDimZ = arith.constant 8 : index
524524
525525 gpu.launch blocks (%bx , %by , %bz ) in (%grid_x = %gDimX , %grid_y = %gDimY , %grid_z = %gDimZ )
526- threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ ) {
526+ threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ )
527+ module (@test_module ) function (@test_kernel_func ) {
527528 " some_op" (%bx , %tx ) : (index , index ) -> ()
528529 gpu.terminator
529- } { kernelModule = @test_module , kernelFunc = @test_kernel_func }
530+ }
530531 return
531532}
532533
533534// -----
534- // This test tests the two optional attributes kernelModule and kernelFunc for gpu.launch, when kernelModule already exists.
535+ // This test tests the two optional attributes `module` and `function` for gpu.launch, when kernelModule already exists.
535536
536537// CHECK-LABEL: gpu.module @existing_module
537538// CHECK: gpu.func @test_kernel_func()
@@ -556,15 +557,16 @@ func.func @testExistingModule() {
556557 %bDimZ = arith.constant 8 : index
557558
558559 gpu.launch blocks (%bx , %by , %bz ) in (%grid_x = %gDimX , %grid_y = %gDimY , %grid_z = %gDimZ )
559- threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ ) {
560+ threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ )
561+ module (@existing_module ) function (@test_kernel_func ) {
560562 " some_op" (%bx , %tx ) : (index , index ) -> ()
561563 gpu.terminator
562- } { kernelModule = @existing_module , kernelFunc = @test_kernel_func }
564+ }
563565 return
564566}
565567
566568// -----
567- // This test tests the optional attribute kernelModule for gpu.launch.
569+ // This test tests the optional attribute `module` for gpu.launch.
568570// CHECK-LABEL: func.func @testKernelModuleOnly()
569571// CHECK: gpu.launch_func @test_module::@testKernelModuleOnly_kernel blocks in (%[[GRID_X:.*]], %[[GRID_Y:.*]], %[[GRID_Z:.*]]) threads in (%[[BLOCK_X:.*]], %[[BLOCK_Y:.*]], %[[BLOCK_Z:.*]])
570572// CHECK: gpu.module @test_module
@@ -578,15 +580,16 @@ func.func @testKernelModuleOnly() {
578580 %bDimZ = arith.constant 8 : index
579581
580582 gpu.launch blocks (%bx , %by , %bz ) in (%grid_x = %gDimX , %grid_y = %gDimY , %grid_z = %gDimZ )
581- threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ ) {
583+ threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ )
584+ module (@test_module ) {
582585 " some_op" (%bx , %tx ) : (index , index ) -> ()
583586 gpu.terminator
584- } { kernelModule = @test_module }
587+ }
585588 return
586589}
587590
588591// -----
589- // This test tests the optional attribute kernelFunc for gpu.launch.
592+ // This test tests the optional attribute `function` for gpu.launch.
590593// CHECK-LABEL: func.func @testKernelFuncOnly()
591594// CHECK: gpu.launch_func @test_kernel_func::@test_kernel_func blocks in (%[[GRID_X:.*]], %[[GRID_Y:.*]], %[[GRID_Z:.*]]) threads in (%[[BLOCK_X:.*]], %[[BLOCK_Y:.*]], %[[BLOCK_Z:.*]])
592595
@@ -601,15 +604,16 @@ func.func @testKernelFuncOnly() {
601604 %bDimZ = arith.constant 8 : index
602605
603606 gpu.launch blocks (%bx , %by , %bz ) in (%grid_x = %gDimX , %grid_y = %gDimY , %grid_z = %gDimZ )
604- threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ ) {
607+ threads (%tx , %ty , %tz ) in (%block_x = %bDimX , %block_y = %bDimY , %block_z = %bDimZ )
608+ function (@test_kernel_func ) {
605609 " some_op" (%bx , %tx ) : (index , index ) -> ()
606610 gpu.terminator
607- } { kernelFunc = @test_kernel_func }
611+ }
608612 return
609613}
610614
611615// -----
612- // This test tests gpu.launch when optional attributes kernelModule and kernelFunc are not specified.
616+ // This test tests gpu.launch when optional attributes `module` and `function` are not specified.
613617// CHECK-LABEL: func.func @testNoAttributes()
614618// CHECK: gpu.launch_func @testNoAttributes_kernel::@testNoAttributes_kernel blocks in (%[[GRID_X:.*]], %[[GRID_Y:.*]], %[[GRID_Z:.*]]) threads in (%[[BLOCK_X:.*]], %[[BLOCK_Y:.*]], %[[BLOCK_Z:.*]])
615619
0 commit comments