diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-06-22 15:53:50 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-06-22 15:53:50 +0000 |
commit | 7be075335dca4f9b2a325a39b9a5a363ea7c6327 (patch) | |
tree | 4f4b4d6684e171184d4712aa7b58c86f02928a90 /openmp/runtime/src/kmp_affinity.cpp | |
parent | bdf509aaaf82457f0cd618fe7b0fea3620b2a40a (diff) | |
download | bcm5719-llvm-7be075335dca4f9b2a325a39b9a5a363ea7c6327.tar.gz bcm5719-llvm-7be075335dca4f9b2a325a39b9a5a363ea7c6327.zip |
Re-enable Visual Studio Builds.
I tried to compile with Visual Studio using CMake and found these two sections of code
causing problems for Visual Studio. The first one removes the use of variable length
arrays by instead using KMP_ALLOCA(). The second part eliminates a redundant cpuid
assembly call by using the already existing __kmp_x86_cpuid() call instead.
llvm-svn: 240290
Diffstat (limited to 'openmp/runtime/src/kmp_affinity.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_affinity.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index d9ff4e62200..32a04465fe8 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -4504,11 +4504,11 @@ void __kmp_balanced_affinity( int tid, int nthreads ) } else { // nthreads > __kmp_ncores // Array to save the number of processors at each core - int nproc_at_core[ ncores ]; + int* nproc_at_core = (int*)KMP_ALLOCA(sizeof(int)*ncores); // Array to save the number of cores with "x" available processors; - int ncores_with_x_procs[ nth_per_core + 1 ]; + int* ncores_with_x_procs = (int*)KMP_ALLOCA(sizeof(int)*(nth_per_core+1)); // Array to save the number of cores with # procs from x to nth_per_core - int ncores_with_x_to_max_procs[ nth_per_core + 1 ]; + int* ncores_with_x_to_max_procs = (int*)KMP_ALLOCA(sizeof(int)*(nth_per_core+1)); for( int i = 0; i <= nth_per_core; i++ ) { ncores_with_x_procs[ i ] = 0; |