MCPcopy Create free account
hub / github.com/Arm-Examples/ML-examples / create_cpu_options

Function create_cpu_options

kleidiai-examples/audiogen/app/audiogen.cpp:160–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160static litert::Options create_cpu_options(size_t num_threads, uint32_t xnnpack_flags) {
161 auto options = get_litert_value(litert::Options::Create());
162 AUDIOGEN_CHECK(options.SetHardwareAccelerators(litert::HwAccelerators::kCpu));
163 auto& cpu_options = get_litert_value(options.GetCpuOptions());
164 AUDIOGEN_CHECK(cpu_options.SetNumThreads(static_cast<int>(num_threads)));
165 AUDIOGEN_CHECK(cpu_options.SetXNNPackFlags(xnnpack_flags));
166 return options;
167}
168
169static void read_wav(const std::string& path, std::vector<float>& left_ch, std::vector<float>& right_ch) {
170 // You can use this command to convert the file to the expected format:

Callers 1

mainFunction · 0.85

Calls 1

get_litert_valueFunction · 0.85

Tested by

no test coverage detected