본문 바로가기

Computer195

[CUDA] 병령 프로그래밍 1 다음은 두 Array의 합을 GPU로 구하는 간단한 코드이다.#include #define N 1000__global__ void add(int *a,int *b,int *c){ /* (1) */ int tid=blockIdx.x; if(tid 2014. 1. 14.
[CUDA] Device 정보 Query 하기 1. Cuda 지원 디바이스 개수 조회 다음은 cuda 지원 디바이스 개수를 조회하는 API 이다.다음과 같이 사용한다.int count;cudaGetDeviceCount(&count); 2. Cuda 지원 디바이스 정보 조회다음은 cuda 지원 디바이스의 정보를 조회하는 API 이다. cudaDeviceProp 구조체는 다음의 URL에서 각 멤버에 대한 설명을 찾을 수 있다. http://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp 다음과 같이 사용한다.cudeDeviceProp prop;cudaGetDeviceProperties(&prop,0); //여기에서 0은 Cuda 디바이스 Number이.. 2013. 10. 13.
[CUDA] Hello World 다음은 CUDA를 이용하여 GPU(이하 Device)에서 Hello World 문자를 설정하고 이를 CPU(이하 Host)에서 출력하는 프로그램 예제이다. #include /* 1) */ __global__ void cudahelloworld(char *c){ int i=0; char *cudahello="hello world"; for(i=0;i 2013. 10. 9.
[java] interface의 ipaddress를 가져오기 http://www.javaprogrammingforums.com/java-networking-tutorials/265-how-get-your-computer-name-ip-address.html 에서 퍼옴 2013. 8. 17.
Hadoop MapReduce에서 외부 jar 파일 사용하기 Hadoop 의 mapreduce process에서 외부 jar 파일을 이용하기 위해서는 필요한 CLASSPATH 를 HADOOP_CLASSPATH 로 지정해 주면 된다. (hadoop-.1.1.2 버전) 또는 hadoop jar 명령시 -libjars 에 설정해주면 된다. 다음 링크 확인 http://blog.cloudera.com/blog/2011/01/how-to-include-third-party-libraries-in-your-map-reduce-job/ 2013. 7. 13.
HDFS 이용하기 1. Java 에서 HDFS 이용하기 1) 다음을 import 해야 한다. import org.apache.hadoop.fs.Path import org.apache.hadoop.fs.FileSystem import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; 2) FileSystem 객체가 기본적으로 파일 처리를 위한 객체로 다음과 같이 참조를 얻는다. FileSystem hdfs=FileSystem.get(Configuration객체); - Configuration객체는 Configuration conf=new Configuration(); 으로 생성하거나 MapReduce에서는 conte.. 2013. 7. 9.