| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This patch contains all gcc changes required to build x32 compiler.
They are backported from 4.8/trunk.
Change-Id: I923f639c1f0cee5812b0f555a39bab0bd0723865
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android does support SYS_gettid and SYS_futex which allows
libgomp to use libgomp/config/linux/* instead of
libgomp/config/posix and enables more features such as
thread affinity.
For GCC4.4.3/ARM, the missing linux/futex.h is copied from
GCC 4.6
Also guard the new sc_nprocessors_actu with __ANDROID__,
and fix return value in proc.c
Change-Id: Ib22496075ac5e41c5f44f5160d1b34a5609c168b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.PURPOSE
This patch is to improve the detection of total CPU count for OpenMP/Linux.
This patch helps that OpenMP recognizes the actual CPUs correctly for
the task parallelism.
Recent mobile devices dynamically disable or enable CPU cores on demand to
optimize battery life. This impacts the output of '/proc/cpuinfo' (which only
reports active ones). This patch provides a way to compute the total
number of cores by parsing the content of '/sys/devices/system/cpu/' instead.
Actual CPUs: total installed CPUs
Online's CPUs: CPUs of the turn-on status
Offline's CPUs: CPUs of the turn-off status
Therefore, We need to enhance the existing approach using procfs like
'/proc/cpuinfo/' or '/proc/stat'. This patch is suitable for Linux kernel.
This patch is based on GCC 4.7.2.
.RELATED LINKS:
https://android-review.googlesource.com/#/c/52821/
https://android-review.googlesource.com/#/c/51950/
https://android-review.googlesource.com/#/c/51370/
https://android.googlesource.com/toolchain/gcc/
.UNIT TEST
int main (int argc, char *argv[])
{ int nthreads, tid;
printf("SC_NPROCESSORS_ONLN: %d\n", sysconf (_SC_NPROCESSORS_ONLN));
/* Fork a team of threads giving them their own copies of variables */
{
/* Obtain thread number */
tid = omp_get_thread_num();
printf("Hello World from thread = %d\n", tid);
/* Only master thread does this */
if (tid == 0)
{
nthreads = omp_get_num_threads();
printf("Number of threads = %d\n", nthreads);
}
} /* All threads join master thread and disband */
}
.LIMITATION OF SCOPE
These functions have to be included in Bionic C library
as the resource of sysconf().
Examples:
_SC_NPROCESSORS_ONLN /proc/stat (= /sys/devices/system/cpu/online)
_SC_NPROCESSORS_CONF /proc/cpuinfo (= /sys/devices/system/cpu/online)
_SC_NPROCESSORS_ACTU /sys/devices/system/cpu/present (* Future work)
.COST EVALUATION OF SYSCALLS (On 32bit Quad core)
------------------------------------------
time seconds usecs/call calls syscall
------------------------------------------
-nan 0.000000 0 3 read
-nan 0.000000 0 9 write
-nan 0.000000 0 4 open
-nan 0.000000 0 4 close
-nan 0.000000 0 1 execve
-nan 0.000000 0 1 access
-nan 0.000000 0 1 brk
-nan 0.000000 0 1 munmap
-nan 0.000000 0 2 mprotect
-nan 0.000000 0 7 mmap2
-nan 0.000000 0 3 fstat64
-nan 0.000000 0 1 set_thread_area
------------------------------------------
100 0.000000 0 37 total
Change-Id: I2c6e41616f309eee89ee1145e92201ffe73463f4
Signed-off-by: Geunsik Lim <leemgs@gmail.com>
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
Acked-by: Changwoo Min <multics69@gmail.com>
CC: David Turner <digit@android.com>
CC: Keith Obenschain <obenschaink@gmail.com>
CC: Pavel Chupin <pavel.v.chupin@intel.com>
CC: Andrew Hsieh <andrewhsieh@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch supports OpenMP library to parallelize the existing
C/C++ code (e.g: for task parallelism) rapidly/easily without
any modification of android platform on multicore embedded devices.
The original patch is made by Keith Obenschain (using GCC 4.4.3).
. Archive - https://android-review.googlesource.com/#/c/34491/
I just moved GCC version from 4.4.3 to 4.7.2 for ktoolchain
version 2.5. The patch is good to me when I evaluate a lot of
C/C++ source code with OpenMP's #parama. we move the version
of OpenMP from version 2.5 to version 3.1.
Please, refer to the "kandroid toolchain" menu in www.kandroid.org
to compile source code including bionic and openmp library on real
Android devices.
http://kandroid.org/board/board.php?board=toolchain&command=body&no=16
I tested Openmp library with the latest GCC 4.7.2 on Android/ARM
devices as following. Please refer to the below example.
geunsik@rhel6$> ./arm-linux-androideabi-gcc openmptest.c -L
/usr/local/ktoolchain-cortexa9-ver2.5-20120515-bionic/arm-linux-androideabi/lib
-lgomp -o openmptest [ENTER]
geunsik@rhel6$>
geunsik@rhel6$>
geunsik@rhel6$> file ./openmptest
./openmptest: ELF 32-bit LSB executable, ARM, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
Change-Id: I20cb3c1ac5c000445c043310158179723bd69fe2
Signed-off-by: Geunsik Lim <leemgs@gmail.com>
Acked-by: Geunsik Lim <geunsik.lim@gmail.com>
|
|
Change-Id: I4a2f5a921c21741a0e18bda986d77e5f1bef0365
|