21 TEST_CASE(
"OptimizeValidateGpuDeviceSupportLayerNoFallback")
40 ClWorkloadFactoryHelper::GetFactory(ClWorkloadFactoryHelper::GetMemoryManager());
43 for (
auto&& layer : theGraph)
47 layer->CreateWorkload(fact));
51 TEST_CASE(
"FP16TurboModeTestOnGpuAcc")
66 auto input = net->AddInputLayer(0,
"input layer");
70 activation1Descriptor.
m_A = 1.f;
71 activation1Descriptor.
m_B = -1.f;
72 auto activation = net->AddActivationLayer(activation1Descriptor,
"activation layer");
73 auto output = net->AddOutputLayer(0,
"output layer");
77 activation->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
82 activation->GetOutputSlot(0).SetTensorInfo(info);
93 *net, backends, runtime->GetDeviceSpec(), optimizerOptions);
98 CHECK(graph.GetNumLayers() == 5);
108 TEST_CASE(
"FastMathEnabledTestOnGpuAcc")
127 *net, backends, runtime->GetDeviceSpec(), optimizerOptions);
133 CHECK(modelOptionsOut.size() == 1);
134 CHECK(modelOptionsOut[0].GetOption(0).GetName() ==
"FastMathEnabled");
135 CHECK(modelOptionsOut[0].GetOption(0).GetValue().AsBool() ==
true);
138 TEST_CASE(
"CheckMLGOTuningFile")
146 bool call_reload_from_file()
148 return m_MLGOTuner.reload_from_file(m_MLGOTuningFile);
152 const std::string validText{
154 "gemm-version, [1,2,1]\n" 157 "<heuristics-table>\n" 158 "0, g71 , 8, f32, best-performance, static, gemm-type, [m,n,k,n]\n" 159 "1, g71 , 8, f32, best-performance, static, gemm-config-reshaped-only-rhs, [m,n,k,n]\n" 160 "2, g71 , 8, f32, best-performance, static, gemm-config-reshaped, [m,n,k,n]\n" 161 "3, g71 , 8, qasymm8, best-performance, static, gemm-type, [m,n,k,n]\n" 162 "4, g71 , 8, qasymm8, best-performance, static, gemm-config-reshaped-only-rhs, [m,n,k,n]\n" 163 "5, g71 , 8, qasymm8, best-performance, static, gemm-config-native, [m,n,k,n]\n" 164 "</heuristics-table>\n" 166 "b , 0, var, r_mn, >=, num, 2., 1, 2\n" 167 "l , 1, gemm-type, reshaped\n" 168 "l , 2, gemm-type, reshaped-only-rhs\n" 171 "l ,0,gemm-config-reshaped-only-rhs, [2, 4,4,4,1,1,0]\n" 174 "l ,0,gemm-config-reshaped,[4,2,8,16,16,1,0,1,0]\n" 177 "l , 0, gemm-type, native\n" 180 "l ,0,gemm-config-reshaped-only-rhs, [2, 4,4,4,1,1,0]\n" 183 "l ,0,gemm-config-native,[4,2,8]\n" 186 const std::string invalidText{
"ʕノ•ᴥ•ʔノ ︵ ┻━┻"};
193 std::ofstream ofs1{validFile};
194 ofs1 << validText << std::endl;
197 std::ofstream ofs2{invalidFile};
198 ofs2 << invalidText << std::endl;
201 catch (std::exception &e)
203 std::cerr <<
"Unable to write to file at location [" << validFile.c_str() <<
"] : " << e.what() << std::endl;
212 {
"MLGOTuningFilePath", validFile.c_str()}
217 ClBackendContextTestClass clBackendContext1(creationOptions1);
218 CHECK(clBackendContext1.call_reload_from_file());
224 {
"MLGOTuningFilePath", invalidFile.c_str()}
230 ClBackendContextTestClass clBackendContext2(creationOptions2);
231 CHECK(clBackendContext2.call_reload_from_file() ==
false);
237 {
"MLGOTuningFilePath",
"not_a_real_file_path"}
243 ClBackendContextTestClass clBackendContext3(creationOptions3);
244 CHECK(clBackendContext3.call_reload_from_file() ==
false);
ModelOptions m_ModelOptions
static IRuntimePtr Create(const CreationOptions &options)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
bool GraphHasNamedLayer(const armnn::Graph &graph, const std::string &name)
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
std::vector< BackendOptions > m_BackendOptions
Pass backend specific options.
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Create an optimized version of the network.
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
GPU Execution: OpenCL: ArmCompute.
An ActivationDescriptor for the ActivationLayer.
min(a, max(b, input)) ReLu1 & ReLu6.
Graph & GetGraphForTesting(IOptimizedNetwork *optNet)
Struct for the users to pass backend specific options.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
ModelOptions & GetModelOptionsForTesting(IOptimizedNetwork *optNet)
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
fs::path NamedTempFile(const char *fileName)
Returns a path to a file in the system temporary folder. If the file existed it will be deleted...
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
static INetworkPtr Create(NetworkOptions networkOptions={})
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).