Wednesday, December 12, 2012

새로운 시작

새로운 시작!!
프로젝트도 끝났고 하니깐 ㅎㅎ

Thursday, April 26, 2012

어이!

인생은 등수가 전부가 아냐..
행복은 성적순이 절대 아니고!!
힘내라.

Thursday, April 12, 2012

OpenGL ES 3.0

은 OpenGL 3.3 과 4.x + additional APIs 가 들어 간다는 이야기가.

Tuesday, March 27, 2012

OpenMP :)

TI device로 심플 OpenMP테스트 해본 결과 10% 정도 빨라 지는걸 확인 하였다..
하지만 Omap 4430 프라다 의 경우 듀얼 코어 뿐이므로 별로 기대를....

Nvidia 쿼드 코어 ap30 소스 받아서 한번 툴체인 바꾸고 해봐야 겠다..
아.... 되니깐 이리 할게 많아 지는구나 ^^;
퀄컴... 신발... 내 3주를 돌려줘 ㅠ

Friday, March 23, 2012

아...놔.. openMP

지금까지 Qcom 꺼 디바이스로 계속 시도 하고 있었는데 한 4주동안...
TI꺼로 해보라고 하시는 말씀 듣고 TI꺼로 linaro toolchain 으로 빌드 하니깐...
잘 돌아 간다.. 아놔... 왜.... ㅠㅠ
아마 Qcom쪽에서 OBJ을 주는게 싱크가 안맞나 부다

openMP이제 해보자 !! 아자아자

Wednesday, March 21, 2012

Tuesday, March 20, 2012

Linaro 밑 받은 메일 총정리 ㅋ

OpenMP 에 관해서 여려가지 질문을 했다.. linaro랑 google에게
linaro 답장


Hi,
Apparently, people have already started experimenting in this area. See http://groups.google.com/group/android-ndk/browse_thread/thread/a547eac5446035b4?pli=1
We are definitely interested in contributions in this area (patches, benchmarks...). Don't hesitate to keep us posted on your progress in this area.
Thanks,
Michael.
원래 저 링크에 있는 사람이랑 이야기 하고 있어서 또 그사람 한테 물어 봤다. 답장.
Sean,

  When you use the patched ics tool chain, you specify on the compile/link step to use OpenMP.  From there it should include the header files and libraries for OpenMP.

  The tool chain is basically the same as the ones that ship with the NDK, but patched/rebuilt with OpenMP enabled.

난 프레임 워크에서 쓰고 싶은거니깐. 근데 신기 하게 이놈은 header 파일이랑 libraries 만 넣어서 된다는거다..
응? 그럼 지금 내가 하고 있는것도 되야 하는데?
란 생각과 함께 최대한 툴체인 안바꾸고도 가능 하겠네 란 생각이 들었다..
여튼 패치 받고 해봐야 겠다..


Tuesday, March 13, 2012

openMP

빌드는 되었는데...
툴체인으로 프레임 워크 단에서 한곳만 따로 빌드는 성공 했는데
안돌아 간다..
세그폴트 뜬다 ㅠㅠ;(
어째야 할까 ㅠㅠ 에혀

정말 쓸수 있긴 하는걸까 ㅠ

Monday, March 12, 2012

Almost get there OpenMP

툴체인을 빌드 하고
libstdc++.so.6 에러도 잡고
해서 안드로이드 소스를 빌드 했는데
omp.h를 잡는데
openMP APIs 하나도 못잡는다
왜이러지 하면서 구글링 해봤는데
컨피규어에서 --disable-libgomp 하란다 응?? 그럼 안쓴다는거 아닌가
툴체인을 빌드 하면서 계속 해서
--enable-libgomp 를 했었는데
이렇게 하면 internal libgomp 를 statically 하게 사용 하는걸 인에이블 하는거였다...
아 이러면 안되는데
--disable-libgomp 하고 빌드 하고
Android.mk 에서
LOCAL_CXX잡아주고
LOCAL_CFLAGS += -fopenmp해주고
빌드 해보련다...
거의 다온거 같다.. 끝이 보이는듯하다.

Sunday, March 11, 2012

요새 본 영화중 가장 재미 있게 본 영화.. 특히.. 하늘 나는 그 장면은 ㅠㅠ

Thursday, March 8, 2012

OpenMP Continue...;)

다시 새로운 빛 등장.. 두둥...
안드로이드에 보면

LOCAL_CCIf you want to use a different C compiler for this module, set LOCAL_CC to the path to the compiler. If LOCAL_CC is blank, the appropriate default compiler is used.
라는 놈이 있다.. 컴파일러를 바꿔 주는것이다.
4.6 을 쓰기 위한 처절한 노력 끝에 이놈을 쓰기로 결정
지금 내가 하고 있는 프래임 워크 단에서


 # SJIT: Enabling openMP Using different toolchain -Sean2.kim@lge.com
 23 # =================================================================
 24 LOCAL_CC := prebuilt/linux-x86/toolchain/android-toolchain-eabi-4.6.3/bin/arm-linux-androideabi-gcc
 25 LOCAL_LDLIBS := -lpthread -fopenmp
 26 LOCAL_C_INCLUDE := prebuilt/linux-x86/toolchain/android-toolchain-eabi-4.6.3/arm-linux-and    roideabi/lib
 27 # =================================================================

이런식으로 넣어 주고 내가 빌드한 컴파일러 연결
라이브러리 연결
빌드중..
되었으면 좋겠다..
되었으면 좋겠다... 한국 가자 ㅠ

Tuesday, March 6, 2012

libgomp continueeeeee;(

이제 발생한 문제
내 빌드 써버는 gcc 버전이 4.4 인데
4.6버전으로 툴체인을 빌드 하기 위해선 필요한 것들이 생긴다..
이 문제를 잠깐 막아 보기 위해서
내 폴더 상단에서
bin 와 lib폴더들을 만들고
export로 LD_LIBRARY_PATH , PATH를 지정해 두었는데
이건 매번 바꿔 줘야 하기때문에 잠시만 이렇게 해두고..
먼저 일단 빌드 되는걸 봐야 할거 같다..

OpenMP continue ;)

Toolchain 이 문제다.. Toolchain 에서 $grep -RHn disable-libgomp . 을 해보면 바이너리들이 libgomp 를  disable 하고 있는게 나온다 ..
그래서 컨피규레이션을 바꾸고 했었지만 알게된 사실은 거기서 바꿔 봐야 bin은 바뀌지 않는 다는거.

linaro 에서 툴체인 받고 gcc4.6 버전으로 받고 안드로이드 툴체인을 빌드 해 보니
bin에서 libgomp 를 Enable 하고 있다 오예~

그 툴체인으로 빌드 중에 vm쪽에서 에러가 떳는데 확인중...
뭔가 진전이 보인다.

Monday, March 5, 2012

grep 으로 찾고 multi 파일 sed로 바꾸기

요즘 내가 자주 쓰는 것중 하나
Hyung이라는 text가 들어 있는 파일을 찾아 Hyung을  Sean으로 바꿔보자
grep 이랑 sed그리고 xargs를 쓰면 되는데
grep = Hyung이라는 text가 들어 있는 파일 찾는 명령어
sed = text를 바꿀때 쓰는 명령어
이 두명령어를 같이 쓰려면
$grep -rl Hyung . | xargs sed -i -e 's/Hyung/Sean/g'
요런식으로 해주면 슈루루룩 바뀐다
와우..........

openMP 새로운 문제..

빌드는 되는데 보니깐 openMP가 작동을 안한다 ㅠㅠ
로그를 넣어 보고서야 알게 되었다.. 난 바보 인가..
역시 toolchain 이 문제 인데
external/openCV에서는 다른 툴체인을 사용 하는것으로 보인다
Framework에서 같은 툴체인으로 빌드를 하면 안되는건가..
disable되어 있는 configuration을 바꿔 주면 빌드 초기에 prebuilt를 하다가 에러가 생긴다.
아으 ㅠ

Friday, March 2, 2012

samba uses linked folder;)

If you are using samba, sometimes you need to add linked folder.
you can easily link the folder, however samba will block to access that folder.
What can we do then?

We can easily change samba setting and restart it ;)

$sudo vim /etc/samba/smb.conf 
in the [global] you can easily add
wide links = yes

and restart samba;)
$sudo restart /etc/init.d/smbd

That's it;) you can now browse linked folder... nice..

Fastboot ERROR:???

폰에 시스템이나 붓 이미지를 넣는데 에러가 생겼다라면?
파티션이 모자르다 라고 말한다면?
파일 싸이즈가 너무 크다라면?? 어떻게 해야 할까?

이 상황은 아마 무엇인가 소스를 고치고 파일 크기가 커져서 생기는 경우이다.
원래 빌드가 잘되고 있었다라면;)

파티션 싸이즈는 device 단에 빌드한 디바이스 명칭 아래 보면
BoardConfig.mk 란 파일이 있을것이다 여기에 보면
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912
요런 식으로 파티션 사이즈를 잡아 둔것이 있을것이다.

고럼 한번 ls out/target/product/....../ -al
을 쳐보면 아마 정말 아마 system.img파일크기가 저 크기를 넘기고 있진 않을까?
저 놈만 바꿔 주고 aboot을 넣어 주면 파티션 크기가 바뀌게 된다.. ;)
참 쉽죠잉~

Thursday, March 1, 2012

The Good Example of openMP

in the external/opencv, it uses openMP ;)
the thing is that they don't have fopenmp in the Android.mk file nor
include <omp.h> in their header files.
Don't know how it works without those;)
but after I follow those rules, I could finally build it.

And now all I want to see is, does it really working with several threads or not.
Let's see;)

openMP :(:(:(:(

자.. 문제가 드뎌 보인다..
툴 체인에서
openMP가 disable 되어 있다.
grep -rl disable-libgomp . | xargs sed -i 's/disable-libgomp/enable-libgomp/g'
요런 명령어로 디스에이블 되어 있는 안드로이드 툴 체인으로 바꿔 줬더만
프리빌트에서 빌드 하다 에러...
구글링 하니깐 이 상황에 빠진 사람들이 있는거 같다 ㅠㅠ

뭔가.. 방법을 찾아야 한다.. 아아아

openMP :(

지금 내가 마주친 문제..
openMP APIs를 사용 하기 위해선
맞는 툴 체인을 사용해야 하는데
openMP 소스랑 헤더가 들어 있는 툴체인은 sdk용이다.. 음..
Frameworks 쪽에서 쓰기 위해선 뭔짓을 해야 하는거지..
일단 소스랑 헤더를 옮겨 보고 해봐야 겠다..
음... 약간 골치.. 아픔.

Tuesday, February 28, 2012

openMP enabling in Makefile

쿨럭 이걸 빼먹다니..
openMP를 Enabling 하기 위해선..
옵션에
CFLAGS = -fopenmp 가 필요 하다 뭐?? 이리 간단해?
그럼 안드로이드에선
LOCAL_CFLAGS += -fopenmp를 하면 되것군... 이제 빌드중... 형 제발 ㅠㅠ

한가지 더, 옵션 스페시픽을 위해서
CFLAGS = -std=gnu9x 를 넣어 주는데
안드로이드에선 아마... 아마.. 않넣어도 될듯 이미.. GCC 4.4.x 를 사용하니깐..
제발..

Monday, February 27, 2012

OpenGL|ES 2.0

Android includes support for high performance 2D and 3D graphics with the Open Graphics Library (OpenGL), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that specifies a standard software interface for 3D graphics processing hardware. OpenGL ES is a flavor of the OpenGL specification intended for embedded devices. The OpenGL ES 1.0 and 1.1 API specifications have been supported since Android 1.0. Beginning with Android 2.2 (API Level 8), the framework supports the OpenGL ES 2.0 API specification.


OpenGL 은 그림을 그리는 툴, 그리는 솜씨라고 생각 하면된다.
EGL 이 준비 해놓은 캔버스에 그림을 그리는것이다. EGL 은 캔버스(메모리) 그리고 OpenGL|ES 2.0 이 사용할수 있는것들을 마련해 둔다, 그리고 디폴트 디스플래이 (LCD)를 확인한다.
그러면 OpenGL 을 통해서 그림을 그리는것이다.
응응..

OpenMP example;)





Original Sequential version of MXV in C

 42 #include <stdio.h>
 43 #include <stdlib.h>
 44
 45 void mxv(int m, int n, double * restrict a,
 46          double * restrict b, double * restrict c);
 47
 48 int main(int argc, char *argv[])
 49 {
 50    double *a,*b,*c;
 51    int i, j, m, n;
 52
 53    //printf("Please give m and n: ");
 54    //scanf("%d %d",&m,&n);
 55    printf("runnging 10000 * 10000 matrics x vector\n");
 56    m = 10000;
 57    n = 10000;
 58
 59    if ( (a=(double *)malloc(m*sizeof(double))) == NULL )
 60       perror("memory allocation for a");
 61    if ( (b=(double *)malloc(m*n*sizeof(double))) == NULL )
 62       perror("memory allocation for b");
 63    if ( (c=(double *)malloc(n*sizeof(double))) == NULL )
 64       perror("memory allocation for c");
 65
 66    printf("Initializing matrix B and vector c\n");
 67    for (j=0; j<n; j++)
 68       c[j] = 2.0;
 69    for (i=0; i<m; i++)
 70       for (j=0; j<n; j++)
 71          b[i*n+j] = i;
 72
 73    printf("Executing mxv function for m = %d n = %d\n",m,n);
 74    (void) mxv(m, n, a, b, c);
 75
 76    free(a);free(b);free(c);
 77    return(0);
 78 }
 79
 80 void mxv(int m, int n, double * restrict a, double * restrict b,
 81          double * restrict c)
 82 {
 83    int i, j;
 84
 85    for (i=0; i<m; i++)
 86    {
 87       a[i] = 0.0;
 88       for (j=0; j<n; j++)
 89          a[i] += b[i*n+j]*c[j];
 90    }

and OpenMP 
 42 #include <stdio.h>
 43 #include <stdlib.h>
 44
 45 void mxv(int m, int n, double * restrict a,
 46          double * restrict b, double * restrict c);
 47
 48 int main(int argc, char *argv[])
 49 {
 50    double *a,*b,*c;
 51    int i, j, m, n;
 52
 53    //printf("Please give m and n: ");
 54    //scanf("%d %d",&m,&n);
 55    printf("running 10000 * 10000 matrics x vectors\n");
 56    m = 10000;
 57    n = 10000;
 58
 59    if ( (a=(double *)malloc(m*sizeof(double))) == NULL )
 60       perror("memory allocation for a");
 61    if ( (b=(double *)malloc(m*n*sizeof(double))) == NULL )
 62       perror("memory allocation for b");
 63    if ( (c=(double *)malloc(n*sizeof(double))) == NULL )
 64       perror("memory allocation for c");
 65
 66    printf("Initializing matrix B and vector c\n");
 67    for (j=0; j<n; j++)
 68       c[j] = 2.0;
 69    for (i=0; i<m; i++)
 70       for (j=0; j<n; j++)
 71          b[i*n+j] = i;
 72
 73    printf("Executing mxv function for m = %d n = %d\n",m,n);
 74    (void) mxv(m, n, a, b, c);
 75
 76    free(a);free(b);free(c);
 77    return(0);
 78 }
 79
 80 void mxv(int m, int n, double * restrict a, double * restrict b,
 81          double * restrict c)
 82 {
 83    int i, j;
 84 #pragma omp parallel for default(none) \
 85         shared(m,n,a,b,c) private(i,j)
 86    for (i=0; i<m; i++)
 87    {
 88       a[i] = 0.0;
 89       for (j=0; j<n; j++)
 90          a[i] += b[i*n+j]*c[j];
 91    } /*-- End of omp parallel for --*/
 92 }

OpenMP will check your processors and will create # of threads.
in my case it creates 16 threads for doing mxv functions.

you can check # of threads with omp_get_number_threads();
and also set # of threads with omp_set_number_threads(#number);
or #pragma omp num_threads(#number)

results for those two sample codes are
 time ./fig3.5.exe
runnging 10000 * 10000 matrics x vector
Initializing matrix B and vector c
Executing mxv function for m = 10000 n = 10000

real    0m1.197s
user    0m0.688s
sys     0m0.508s

 time ./fig3.10.exe
running 10000 * 10000 matrics x vectors
Initializing matrix B and vector c
Executing mxv function for m = 10000 n = 10000

real    0m0.831s
user    0m3.700s
sys     0m0.456s






Friday, February 24, 2012

/system/bin/sh: girl : not found
/system/bin/sh: GF: not found
/system/bin/sh: woman: not found


not found.

My Computer:)

Intel i7 2600k
Nvidia GTX 570
650W PSU Corsair
1TB HDD + 60GB SSD
8GB DDR3 1600
It runs MW3 MAX, SC2 MAX, TERA MAX setting;)
I am gonna buy H80 - H100 coolmaster's liquid cooler for overclocking
and may change PSU someday ;)

SO waiting for Diablo 3 now

Thursday, February 23, 2012

Echoed

http://echoedmusic.com/

ㅋㅋㅋㅋ

#pragma

OpenMP를 쓰려면 #pragma를 사용 해야 하는것을 볼수 있다
역시 SurfaceFlinger.cpp 에서 threadLoop를 보면 바로 펑션 위에
#if 0
#pragma mark -
#pragma mark Main Loop
#endif 라는 구문을 볼수 있다.

그럼
#pragma는 뭘까?

The `#pragma' directive is the method specified by the C standard for providing additional information to the compiler, beyond what is conveyed in the language itself. Three forms of this directive (commonly known as pragmas) are specified by the 1999 C standard. A C compiler is free to attach any meaning it likes to other pragmas.

요놈은 결국 컴파일링 할때 몇몇가지 정보를 주는것이다.
#pragma omap for << 여기서 부터 OpenMP for loop 이 있다! 고로 여기서 부터 뜨래드를 실행하라
뭐 이런식으로 컴파일러에게 정보를 주는것이다.

Wednesday, February 22, 2012

내 .vimrc 설정


  1 set nocompatible
  2
  3 set nu
  4
  5 filetype on
  6
  7 set history=1000
  8
  9 syntax on
 10
 11 set autoindent
 12
 13 set smartindent
 14
 15 set hlsearch
 16
 17 set tabstop=4
 18
 19 set shiftwidth=4
 20
 21 set showmatch
 22
 23 set guioptions-=T
 24
 25 set ruler
 26
 27 set incsearch

내 .bashrc 설정 ;)



 1 # ~/.bashrc: executed by bash(1) for non-login shells.
  2 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3 # for examples
  4 PS1='\[\e[1;32m\][\u\[\e[1;33m\] \w\[\e[1;32m\]] \[\e[0m\]'
  5
  6 # If not running interactively, don't do anything
  7 [ -z "$PS1" ] && return
  8
  9 # don't put duplicate lines in the history. See bash(1) for more options
 10 # ... or force ignoredups and ignorespace
 11 HISTCONTROL=ignoredups:ignorespace
 12
 13 # append to the history file, don't overwrite it
 14 shopt -s histappend
 15
 16 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
 17 HISTSIZE=1000
 18 HISTFILESIZE=2000
 19
 20 # check the window size after each command and, if necessary,
 21 # update the values of LINES and COLUMNS.
 22 shopt -s checkwinsize
 23
 24 # make less more friendly for non-text input files, see lesspipe(1)
 25 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
 26
 27 # set variable identifying the chroot you work in (used in the prompt below)
 28 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
 29     debian_chroot=$(cat /etc/debian_chroot)
 30 fi
 31
 32 # set a fancy prompt (non-color, unless we know we "want" color)
 33 case "$TERM" in
 34     xterm-color) color_prompt=yes;;
 35 esac
 36
 37 # uncomment for a colored prompt, if the terminal has the capability; turned
 38 # off by default to not distract the user: the focus in a terminal window
 39 # should be on the output of commands, not on the prompt
 40 #force_color_prompt=yes
 41
 42 if [ -n "$force_color_prompt" ]; then
 43     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
 44     # We have color support; assume it's compliant with Ecma-48
 45     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
 46     # a case would tend to support setf rather than setaf.)
 47     color_prompt=yes
 48     else
 49     color_prompt=
50     fi
 51 fi
 52
 53 unset color_prompt force_color_prompt
 54
 55 # enable color support of ls and also add handy aliases
 56 if [ -x /usr/bin/dircolors ]; then
 57     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
 58     alias ls='ls --color=auto'
 59     #alias dir='dir --color=auto'
 60     #alias vdir='vdir --color=auto'
 61
 62     alias grep='grep --color=auto'
 63     alias fgrep='fgrep --color=auto'
 64     alias egrep='egrep --color=auto'
 65 fi
 66
 67 # some more ls aliases
 68 alias ll='ls -alF'
 69 alias la='ls -A'
 70 alias l='ls -al'
 71 alias u='cd ..'
 72 alias r='cd ~'
 73 alias p='cd -'
 74 alias mygrep='grep -RHni --exclude=.git --exclude=svn'
 75
 76 # Alias definitions.
 77 # You may want to put all your additions into a separate file like
 78 # ~/.bash_aliases, instead of adding them here directly.
 79 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
 80
 81 if [ -f ~/.bash_aliases ]; then
 82     . ~/.bash_aliases
 83 fi
 84
 85 # enable programmable completion features (you don't need to enable
 86 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
 87 # sources /etc/bash.bashrc).
 88 if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
 89     . /etc/bash_completion
 90 fi


ION


ION

goals
* Share buffers between hardware resource : Camera, Video encoder/decoder, GPU, and Display
* Ability to securely and safely share buffers with userspac
handle process temination
allow secure sharing between processes
* Modular and extensible to map to future hardware designs
요놈은 ICS에서 새로 들어온 메모리 얼로 케이션 메니져 라고 생각 하면 된다.
프로세서들이 많아 지고 그것들이 모두 사용 할수 있는 shared memory가 필요 해서
만든것. Secure sharing between processes 를 지원한다!!

Tuesday, February 21, 2012

Amdahl's law

OpenMP를 읽다가 Amdahl's law 가 나와서 위키를 뒤져 봤는데
아무리 프로 세서가 많아 지더라고 해도 퍼포먼스는 일정양에서 정지 된다.
어라 왜? 란 생각을 했었는데,
95% 의 프로그램이 같이 돌수 있다 하더라도 무지 막지한 프로 세서를 가졌다 하더라도
스피드 업은 20배에서 멈춘다 음..
고래?
이유는 간단하다 5%의 프로그램은 프로 세서를 같이 사용할수 없다.
그말은 5%는 싱글 코어로 돌려야 한다는것.
그래서 내 서버 컴퓨터의 풀빌드걸리는 시간이 30분 정도에서 멈춰 있는건가 ㅡㅡ;
안드로이드는 얼마나 parallel portion 을 가지고 있는지 궁금 하군.
http://en.wikipedia.org/wiki/Amdahl's_law

Saturday, February 18, 2012

MW3

모던 워 페어 3 ㅡㅡ;; 정말 최고의 게임이다..
그다지 중독성은 없지만 그 화질.. 그 음향...
내가 정말 전쟁 속으로 들어간듯한 느낌이랄까 ㅡㅡ;;
살만한 가치가 있는 게임... ㅇㅇ

Friday, February 17, 2012

OpenMP API

supports multi-platform shared-memory parallel programming in C/C++ and Fortran. The OpenMP API defines a portable, scalable model with a simple and flexible interface for developing parallel applications on platforms from the desktop to the supercomputer. 
이번 연도 너로 정했다!!!