1 # Description: 2 # quantization-specific OpKernels for hexagon 3 4 package( 5 default_visibility = ["//visibility:public"], 6 ) 7 8 licenses(["notice"]) # Apache 2.0 9 10 load( 11 "//tensorflow:tensorflow.bzl", 12 "tf_cc_test", 13 "tf_kernel_library", 14 ) 15 16 filegroup( 17 name = "all_files", 18 srcs = glob( 19 ["**/*"], 20 exclude = [ 21 "**/METADATA", 22 "**/OWNERS", 23 ], 24 ), 25 visibility = ["//tensorflow:__subpackages__"], 26 ) 27 28 tf_cc_test( 29 name = "graph_transferer_test", 30 size = "small", 31 srcs = [ 32 "graph_transferer_test.cc", 33 "hexagon_graph_execution_test.cc", 34 ], 35 data = ["//tensorflow/core:example_parser_configuration_testdata"], 36 deps = [ 37 ":graph_transferer", 38 "//tensorflow/cc:cc_ops", 39 "//tensorflow/core:core_cpu", 40 "//tensorflow/core:direct_session", 41 "//tensorflow/core:lib", 42 "//tensorflow/core:ops", 43 "//tensorflow/core:protos_all_cc", 44 "//tensorflow/core:test", 45 "//tensorflow/core:test_main", 46 "//tensorflow/core:testlib", 47 "//tensorflow/core/kernels:cwise_op", 48 "//tensorflow/core/kernels:quantized_ops", 49 "//tensorflow/core/kernels:reduction_ops", 50 "//tensorflow/core/kernels:remote_fused_graph_execute_utils", 51 "//tensorflow/core/kernels:remote_fused_graph_ops", 52 "//tensorflow/core/kernels:reshape_op", 53 "//tensorflow/core/kernels:softmax_op", 54 ], 55 ) 56 57 tf_kernel_library( 58 name = "graph_transferer", 59 srcs = [ 60 "graph_transfer_utils.cc", 61 "graph_transferer.cc", 62 "hexagon_control_wrapper.cc", 63 "hexagon_ops_definitions.cc", 64 "soc_interface.cc", 65 ], 66 hdrs = [ 67 "graph_transfer_utils.h", 68 "graph_transferer.h", 69 "hexagon_control_wrapper.h", 70 "hexagon_ops_definitions.h", 71 "soc_interface.h", 72 ], 73 deps = [ 74 "//tensorflow/cc:cc_ops", 75 "//tensorflow/cc:remote_fused_graph_ops", 76 "//tensorflow/cc:scope", 77 "//tensorflow/core", 78 "//tensorflow/core:core_cpu", 79 "//tensorflow/core:framework", 80 "//tensorflow/core:lib", 81 "//tensorflow/core:protos_all_cc", 82 "//tensorflow/core/kernels:remote_fused_graph_execute_utils", 83 "//third_party/eigen3", 84 ], 85 ) 86 87 cc_library( 88 name = "hexagon_rewriter_transform", 89 srcs = [ 90 "hexagon_rewriter_transform.cc", 91 ], 92 deps = [ 93 ":graph_transferer", 94 "//tensorflow/cc:cc_ops", 95 "//tensorflow/cc:remote_fused_graph_ops", 96 "//tensorflow/tools/graph_transforms:transform_utils", 97 ], 98 alwayslink = 1, 99 ) 100 101 tf_cc_test( 102 name = "hexagon_rewriter_transform_test", 103 size = "small", 104 srcs = ["hexagon_rewriter_transform_test.cc"], 105 deps = [ 106 ":graph_transferer", 107 ":hexagon_rewriter_transform", 108 "//tensorflow/cc:cc_ops", 109 "//tensorflow/core:core_cpu", 110 "//tensorflow/core:core_cpu_internal", 111 "//tensorflow/core:framework", 112 "//tensorflow/core:tensorflow", 113 "//tensorflow/core:test", 114 "//tensorflow/core:test_main", 115 "//tensorflow/core:testlib", 116 "//tensorflow/core/kernels:remote_fused_graph_execute_utils", 117 "//tensorflow/tools/graph_transforms:transform_utils", 118 ], 119 ) 120 121 cc_library( 122 name = "hexagon_remote_fused_graph_executor_build", 123 srcs = [ 124 "hexagon_remote_fused_graph_executor_build.cc", 125 ], 126 deps = [ 127 ":graph_transferer", 128 "//tensorflow/core/kernels:remote_fused_graph_execute_utils", 129 ], 130 alwayslink = 1, 131 ) 132 133 tf_cc_test( 134 name = "hexagon_remote_fused_graph_executor_build_test", 135 size = "small", 136 srcs = ["hexagon_remote_fused_graph_executor_build_test.cc"], 137 deps = [ 138 ":hexagon_remote_fused_graph_executor_build", 139 "//tensorflow/core:test", 140 "//tensorflow/core:test_main", 141 "//tensorflow/core:testlib", 142 "//tensorflow/core/kernels:remote_fused_graph_execute_utils", 143 ], 144 ) 145