- Home /
Question by
ledentsov · Aug 11, 2021 at 05:15 PM ·
androidnative pluginc++parallel
Unity reduces the number of available OpenMP threads
I use OpenMP in a shared android library. There is a sample method that just checks the number of CPUs and the max number of threads.
int maxThreads = omp_get_max_threads();
int numProcs = omp_get_num_procs();
When I call this method from a basic android application (AppCompatActivity), both values are set to 8 on the device with Qualcomm Snapdragon 855 CPU (8 cores).
maxThreads = 8;
numProc = 8;
When I try to call this method from a Unity application, the returned numbers of max threads and procs are 2.
maxThreads = 2;
numProc = 2;
Why the max threads number in the Unity application is less than in the basic app? Is there a way to increase the number of parallel threads that are actually used?
Comment