From f5eb8a40e98224d98be8ca4881c7261d2d04ad17 Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Mon, 22 Jun 2020 10:38:48 -0700 Subject: [PATCH] Change gpu_device_test to cope with CUDA stream priority supporting [-2,0] in CUDA 8 instead of [-1,0] before. PiperOrigin-RevId: 317684869 Change-Id: Ib741cd1015f64358d323dda761250c990ce4ca41 --- .../core/common_runtime/gpu/gpu_device_test.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tensorflow/core/common_runtime/gpu/gpu_device_test.cc b/tensorflow/core/common_runtime/gpu/gpu_device_test.cc index dae744380e9..6448fc56af7 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device_test.cc @@ -234,9 +234,9 @@ TEST_F(GPUDeviceTest, SingleVirtualDeviceWithInvalidPriority) { SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{-1, 2}}); #else - // Priority outside the range (-1, 0) for NVidia GPUs + // Priority outside the range (-2, 0) for NVidia GPUs SessionOptions opts = - MakeSessionOptions("0", 0, 1, {{123, 456}}, {{-2, 0}}); + MakeSessionOptions("0", 0, 1, {{123, 456}}, {{-3, 0}}); #endif std::vector> devices; Status status = DeviceFactory::GetFactory("GPU")->CreateDevices( @@ -249,9 +249,7 @@ TEST_F(GPUDeviceTest, SingleVirtualDeviceWithInvalidPriority) { " virtual device 0 on GPU# 0"); #else ExpectErrorMessageSubstr( - status, - "Priority -2 is outside the range of supported priorities [-1,0] for" - " virtual device 0 on GPU# 0"); + status, "Priority -3 is outside the range of supported priorities"); #endif } { @@ -259,7 +257,7 @@ TEST_F(GPUDeviceTest, SingleVirtualDeviceWithInvalidPriority) { // Priority outside the range (0, 2) for AMD GPUs SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{0, 3}}); #else - // Priority outside the range (-1, 0) for NVidia GPUs + // Priority outside the range (-2, 0) for NVidia GPUs SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{0, 1}}); #endif std::vector> devices; @@ -273,9 +271,7 @@ TEST_F(GPUDeviceTest, SingleVirtualDeviceWithInvalidPriority) { " virtual device 0 on GPU# 0"); #else ExpectErrorMessageSubstr( - status, - "Priority 1 is outside the range of supported priorities [-1,0] for" - " virtual device 0 on GPU# 0"); + status, "Priority 1 is outside the range of supported priorities"); #endif } } @@ -296,7 +292,7 @@ TEST_F(GPUDeviceTest, MultipleVirtualDevices) { // Valid range for priority values on AMD GPUs in (0,2) SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{0, 1}}); #else - // Valid range for priority values on NVidia GPUs in (-1, 0) + // Valid range for priority values on NVidia GPUs in (-2, 0) SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{0, -1}}); #endif std::vector> devices; @@ -347,7 +343,7 @@ TEST_F(GPUDeviceTest, MultipleVirtualDevicesWithPriority) { // Valid range for priority values on AMD GPUs in (0,2) SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{2, 1}}); #else - // Valid range for priority values on NVidia GPUs in (-1, 0) + // Valid range for priority values on NVidia GPUs in (-2, 0) SessionOptions opts = MakeSessionOptions("0", 0, 1, {{123, 456}}, {{-1, 0}}); #endif