@@ -440,10 +440,12 @@ TEST(GatherOpTest, Gather_axis1_scalar_indices) {
440440
441441TEST (ShrunkenGatherOpTest, ShrunkenGather_PositiveAxis) {
442442 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
443- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
443+ // Add CUDA EP first so it gets tested before CPU EP
444+ // (ConfigEps runs the first available EP for the operator)
444445#ifdef USE_CUDA
445446 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
446447#endif
448+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
447449
448450 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
449451 test.AddAttribute <int64_t >(" axis" , 0LL );
@@ -461,10 +463,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_PositiveAxis) {
461463
462464TEST (ShrunkenGatherOpTest, ShrunkenGather_NegativeAxis) {
463465 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
464- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
466+ // Add CUDA EP first so it gets tested before CPU EP
467+ // (ConfigEps runs the first available EP for the operator)
465468#ifdef USE_CUDA
466469 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
467470#endif
471+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
468472
469473 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
470474 test.AddAttribute <int64_t >(" axis" , -1LL );
@@ -482,10 +486,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_NegativeAxis) {
482486
483487TEST (ShrunkenGatherOpTest, ShrunkenGather_InvalidIndicesRank) {
484488 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
485- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
489+ // Add CUDA EP first so it gets tested before CPU EP
490+ // (ConfigEps runs the first available EP for the operator)
486491#ifdef USE_CUDA
487492 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
488493#endif
494+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
489495
490496 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
491497 test.AddAttribute <int64_t >(" axis" , 0LL );
@@ -503,10 +509,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_InvalidIndicesRank) {
503509
504510TEST (ShrunkenGatherOpTest, ShrunkenGather_InvalidInputRank) {
505511 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
506- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
512+ // Add CUDA EP first so it gets tested before CPU EP
513+ // (ConfigEps runs the first available EP for the operator)
507514#ifdef USE_CUDA
508515 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
509516#endif
517+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
510518
511519 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
512520 test.AddAttribute <int64_t >(" axis" , 0LL );
0 commit comments