@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
1313limitations under the License.
1414==============================================================================*/
1515
16- #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM || ENABLE_MKL
16+ #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM || INTEL_MKL
1717
1818#include " tensorflow/core/grappler/optimizers/auto_mixed_precision.h"
1919
@@ -1189,7 +1189,7 @@ TEST_F(AutoMixedPrecisionTest, TanhOp) {
11891189
11901190#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
11911191
1192- #if ENABLE_MKL
1192+ #if INTEL_MKL
11931193
11941194class AutoMixedPrecisionMklTest : public GrapplerTest {
11951195 protected:
@@ -1203,7 +1203,8 @@ class AutoMixedPrecisionMklTest : public GrapplerTest {
12031203};
12041204
12051205TEST_F (AutoMixedPrecisionMklTest, AlreadyBf16) {
1206- tensorflow::Scope s = tensorflow::Scope::NewRootScope ();
1206+ tensorflow::Scope s = tensorflow::Scope::NewRootScope ().WithDevice (
1207+ " /job:localhost/replica:0/task:0/device:CPU:0" );
12071208 Output input = ops::Const (s.WithOpName (" input" ), 1 .f , {32 , 32 });
12081209 Output cst1 = ops::Cast (s.WithOpName (" cst1" ), input, DT_BFLOAT16 );
12091210 Output allow1 = ops::MatMul (s.WithOpName (" allow1" ), cst1, cst1);
@@ -1241,7 +1242,8 @@ TEST_F(AutoMixedPrecisionMklTest, AlreadyBf16) {
12411242}
12421243
12431244TEST_F (AutoMixedPrecisionMklTest, Simple) {
1244- tensorflow::Scope s = tensorflow::Scope::NewRootScope ();
1245+ tensorflow::Scope s = tensorflow::Scope::NewRootScope ().WithDevice (
1246+ " /job:localhost/replica:0/task:0/device:CPU:0" );
12451247 Output input = ops::Const (s.WithOpName (" input" ), 1 .f / 32 , {32 , 32 });
12461248 Output deny1 = ops::Exp (s.WithOpName (" deny1" ), input);
12471249 Output clr1 = ops::Relu (s.WithOpName (" clr1" ), deny1);
@@ -1290,7 +1292,8 @@ TEST_F(AutoMixedPrecisionMklTest, Simple) {
12901292}
12911293
12921294TEST_F (AutoMixedPrecisionMklTest, TensorListSetGet) {
1293- tensorflow::Scope s = tensorflow::Scope::NewRootScope ();
1295+ tensorflow::Scope s = tensorflow::Scope::NewRootScope ().WithDevice (
1296+ " /job:localhost/replica:0/task:0/device:CPU:0" );
12941297 tensorflow::Input shape = {32 , 32 };
12951298 auto tl1 = ops::TensorListReserve (s.WithOpName (" tl1" ), {32 , 32 }, 8 , DT_FLOAT );
12961299 Output input = ops::Const (s.WithOpName (" input" ), 1 .f / 32 , {32 , 32 });
@@ -1365,10 +1368,10 @@ TEST_F(AutoMixedPrecisionMklTest, TensorListSetGet) {
13651368 }
13661369}
13671370
1368- #endif // ENABLE_MKL
1371+ #endif // INTEL_MKL
13691372
13701373} // namespace
13711374} // namespace grappler
13721375} // namespace tensorflow
13731376
1374- #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM || ENABLE_MKL
1377+ #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM || INTEL_MKL
0 commit comments