@@ -440,10 +440,10 @@ 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 ());
444443#ifdef USE_CUDA
445444 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
446445#endif
446+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
447447
448448 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
449449 test.AddAttribute <int64_t >(" axis" , 0LL );
@@ -461,10 +461,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_PositiveAxis) {
461461
462462TEST (ShrunkenGatherOpTest, ShrunkenGather_NegativeAxis) {
463463 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
464- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
464+ // Add CUDA EP first so it gets tested before CPU EP
465+ // (ConfigEps runs the first available EP for the operator)
465466#ifdef USE_CUDA
466467 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
467468#endif
469+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
468470
469471 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
470472 test.AddAttribute <int64_t >(" axis" , -1LL );
@@ -482,10 +484,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_NegativeAxis) {
482484
483485TEST (ShrunkenGatherOpTest, ShrunkenGather_InvalidIndicesRank) {
484486 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
485- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
487+ // Add CUDA EP first so it gets tested before CPU EP
488+ // (ConfigEps runs the first available EP for the operator)
486489#ifdef USE_CUDA
487490 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
488491#endif
492+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
489493
490494 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
491495 test.AddAttribute <int64_t >(" axis" , 0LL );
@@ -503,10 +507,12 @@ TEST(ShrunkenGatherOpTest, ShrunkenGather_InvalidIndicesRank) {
503507
504508TEST (ShrunkenGatherOpTest, ShrunkenGather_InvalidInputRank) {
505509 std::vector<std::unique_ptr<IExecutionProvider>> execution_providers;
506- execution_providers.emplace_back (DefaultCpuExecutionProvider ());
510+ // Add CUDA EP first so it gets tested before CPU EP
511+ // (ConfigEps runs the first available EP for the operator)
507512#ifdef USE_CUDA
508513 execution_providers.emplace_back (DefaultCudaExecutionProvider ());
509514#endif
515+ execution_providers.emplace_back (DefaultCpuExecutionProvider ());
510516
511517 OpTester test (" ShrunkenGather" , 1 , onnxruntime::kMSDomain );
512518 test.AddAttribute <int64_t >(" axis" , 0LL );
0 commit comments