untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 CUDA Vol I: CUDA : NVIDIA Q2 2008

2 GPU...1 CUDA...10 CUDA G8x CUDA CUBLAS CUFFT CUDA CUDA CUDA Fortran CUDA API CUDA...176

3 GPU : Connection Machine MasPar Cray PC P-RAM V-RAM NVIDIA Corporation

4 7 CM-1 MasPar 200 Beowulf Legion NVIDIA Corporation GPU GPU PC NVIDIA Corporation

5 CUDA CUDA Compute Unified Device Architecture GPU NVIDIA NVIDIA GPU C - NVIDIA Corporation CUDA: GPU CPU 1 GPU GPU NVIDIA Corporation

6 GPU NVIDIA Corporation GPU : PDE N : : NVIDIA Corporation

7 Matlab N LIBOR Cmatch NVIDIA Corporation CUDA

8 CPU+GPU CPU GPU DRAM NVIDIA Corporation CUDA 11 CUDA CPU CUDA CUDA CPU : GPU CPU NVIDIA Corporation

9 CUDA ID NVIDIA Corporation : CUDA NVIDIA Corporation

10 GPU NVIDIA Corporation NVIDIA Corporation

11 threadidx.x ID blockidx.x ID blockdim.x blockidx.x blockdim.x = 5 threadidx.x blockidx.x*blockdim.x + threadidx.x NVIDIA Corporation ID ID: 1 2 ID: PDE NVIDIA Corporation

12 CUDA NVIDIA Corporation G SM NVIDIA Corporation

13 NVIDIA Corporation NVIDIA Corporation

14 GPGPUCUDA C NVIDIA Corporation CUDA?? N/A NVIDIA Corporation

15 CUDA CUBA GPU GPU GPU GPU CUDA : API NVIDIA Corporation

16 CPU GPU CPUGPU GPU DRAM NVIDIA Corporation CPU cudamalloc(void ** pointer, size_t nbytes) cudamemset(void * pointer, int value, size_t count) cudafree(void* pointer) int n = 1024; int nbytes = 1024*sizeof(int); int *d_a = 0; cudamalloc( (void**)&d_a, nbytes ); cudamemset( d_a, 0, nbytes); cudafree(d_a); NVIDIA Corporation

17 cudamemcpy(void *dst, void *src, size_t nbytes, enum cudamemcpykind direction); direction src dst CPU : CUDA enum cudamemcpykind cudamemcpyhosttodevice cudamemcpydevicetohost cudamemcpydevicetodevice NVIDIA Corporation CUDA CUDA Correct! solutionsolution NVIDIA Corporation

18 : Windows Microsoft Visual Studio <>.sln 4 Release Debug EmuRelease EmuDebug EmuDebug global device printf 1GPU1CPU GPU NVIDIA Corporation : Linux nvcc <filename>.cu [-o <executable>] nvcc g <filename>.cu GPU nvcc deviceemu <filename>.cu CPU nvcc deviceemu g <filename>.cu CPU gdb linux NVIDIA Corporation

19 1: gcudamallocandmemcpy Part1: d_a d_b Part2: h_a d_a Part3: d_ad_b Part4: d_bh_a Part5: d_a d_b NVIDIA Corporation GPU C GPU void varargs static CPUGPU NVIDIA Corporation

20 global : CPU GPU void device : GPU CPU host : CPU host device : CPUGPU NVIDIA Corporation C kernel<<<dim3 grid, dim3 block>>>( ) <<< >>> : x y : x y z dim3 grid(16, 16); dim3 block(16,16); kernel<<<grid, block>>>(...); kernel<<<32, 512>>>(...); NVIDIA Corporation

21 CUDA global device dim3 griddim; 2 dim3 blockdim; dim3 blockidx; dim3 threadidx; NVIDIA Corporation global void minimal( int* d_a) { *d_a = 13; } global void assign( int* d_a, int value) { int idx = blockdim.x * blockidx.x + threadidx.x; d_a[idx] = value; } NVIDIA Corporation

22 : N b N=16 blockdim=4 4 blockidx.x=0 blockdim.x=4 threadidx.x=0,1,2,3 idx=0123 blockidx.x=1 blockdim.x=4 threadidx.x=0,1,2,3 idx=4567 blockidx.x=2 blockdim.x=4 threadidx.x=0,1,2,3 idx= blockidx.x=3 blockdim.x=4 threadidx.x=0,1,2,3 idx= idx=0,1,2,3 idx=4,5,6,7 idx=8,9,10,11 idx=12,13,14,15 int idx = blockdim.x * blockid.x + threadidx.x; threadidx : blockdim 32 NVIDIA Corporation : CPU void increment_cpu(float *a, float b, int N) { } for (int idx = 0; idx<n; idx++) a[idx] = a[idx] + b; CUDA global void increment_gpu(float *a, float b, int N) { int idx = blockidx.x * blockdim.x + threadidx.x; if (idx < N) a[idx] = a[idx] + b; } void main() {... increment_cpu(a, b, N); } void main() { dim3 dimblock (blocksize); dim3 dimgrid( ceil( N / (float)blocksize) ); increment_gpu<<<dimgrid, dimblock>>>(a, b, N); } NVIDIA Corporation

23 2D global void assign2d(int* d_a, int w, int h, int value) { int iy = blockdim.y * blockidx.y + threadidx.y; int ix = blockdim.x * blockidx.x + threadidx.x; int idx = iy * w + ix; d_a[idx] = value; }... assign2d<<<dim3(64, 64), dim3(16, 16)>>>(...); NVIDIA Corporation CPU CUDA cudamemcpy() CPU CUDA cudathreadsynchronize() CUDA NVIDIA Corporation

24 : // int numbytes = N * sizeof(float) float* h_a = (float*) malloc(numbytes); // float* d_a = 0; cudamalloc((void**)&d_a, numbytes); // cudamemcpy(d_a, h_a, numbytes, cudamemcpyhosttodevice); // increment_gpu<<< N/blockSize, blocksize>>>(d_a, b); // cudamemcpy(h_a, d_a, numbytes, cudamemcpydevicetohost); // cudafree(d_a); NVIDIA Corporation : myfirstkernel Part1: d_a Part2: 1-D 1-D Part3: d_a idx = blockidx.x*blockdim.x + threadidx.x d_a[idx] = 1000*blockIdx.x + threadidx.x Part4: d_ah_a Part5: NVIDIA Corporation

25 GPU device cudamalloc device : shared : 5 NVIDIA Corporation global void kernel( ) global void kernel( ) { { shared float sdata[256]; extern shared float sdata[]; } } int main(void) int main(void) { { kernel<<<nblocks,blocksize>>>( ); smbytes = blocksize*sizeof(float); } kernel<<<nblocks, blocksize, smbytes>>>( ); } NVIDIA Corporation

26 CPUGPU [u]char[1..4], [u]short[1..4], [u]int[1..4], [u]long[1..4], float[1..4] x y z w: uint4 param; int y = param.y; dim3 uint3 (1,1,1) NVIDIA Corporation GPU void syncthreads(); RAW WAR WAW NVIDIA Corporation

27 GPU Compute capability 1.1 G80 = Compute capability 1.0 G84/G86/G92 = Compute capability AND XOR NVIDIA Corporation CPUCUDA CUDA cudaerror_t cudaerror_t cudagetlasterror(void) char* cudageterrorstring(cudaerror_t code) printf( %s n, cudageterrorstring( cudagetlasterror() ) ); NVIDIA Corporation

28 3: d_a {a 0, a 1,, a n-1 } d_b {a n-1, a n-2,, a 0 } greversearray_singleblock 1 N = numthreads = 256 Part1 : greversearrayblock() greversearrayblock() d_a d_b NVIDIA Corporation : d_a {a 0, a 1,, a n-1 } d_b {a n-1, a n-2,, a 0 } greversearray_multiblock 256 N N/256 Part1: Part2: reversearrayblock() NVIDIA Corporation

29 CUDA NVIDIA Corporation nvcc PTX float4 me = gx[gtid]; me.x += me.y * me.z; EDG GPUCPU Open64 GPU PTX Parallel Thread execution (PTX) ISA ld.global.v4.f32 {$f1,$f3,$f5,$f7}, [$r9+0]; mad.f32 $f1, $f5, $f3, $f1; NVIDIA Corporation

30 CUDA nvcc nvcc cudacc g++ cl nvcc CCPU PTX CUDA CUDAcuda CUDA cudart API CUDA NVIDIA Corporation

31 G8x NVIDIA Corporation GPU GPU GPU NVIDIA Corporation

32 vs. = NVIDIA Corporation SDKMatrix Transpose NVIDIA Corporation

33 GPU NVIDIA Corporation G8x

34 : CUDA CUDA CPU : GPU : SIMD : 2 : 1 : GPU1CUDA NVIDIA Corporation G NVIDIA Corporation

35 TPC NVIDIA Corporation NVIDIA Corporation

36 NVIDIA Corporation

37 4GB/s PCIe x vs.76 GB/s Tesla C870 NVIDIA Corporation cudamallochost() cudamemcpy 3.2 GB/s PCIe x GB/s PCIe x CUDA SDKbandwidthTest NVIDIA Corporation

38 C cudamallochost a os CUDA CPU = API: 0 = cudamemcpyasync(dst, src, size, direction, 0); NVIDIA Corporation Compute capability 1.1G84 CUDAv1.1 API cudastreamcreate(&stream1); cudastreamcreate(&stream2); t t cudamemcpyasync(dst, src, size, dir, stream1); kernel<<<grid, block, 0, stream2>>>( ); cudastreamquery(stream2); NVIDIA Corporation

39 G8x GPU NVIDIA Corporation NVIDIA Corporation

40 G8x : NVIDIA Corporation nvcc ptx : ld.global.f32 $f1, [$rd4+0]; // id:74 st.global.f32 [$rd4+0], $f2; // id:75 ld.global.v2.f32 {$f3,$f5}, [$rd7+0]; // st.global.v2.f32 [$rd7+0], {$f4,$f6}; // ld.global.v4.f32 {$f7,$f9,$f11,$f13}, [$rd10+0]; // st.global.v4.f32 [$rd10+0], {$f8,$f10,$f12,$f14};,, // NVIDIA Corporation

41 16 : : 64 - int float int2 float int4 float4 k k k k : NVIDIA Corporation : float NVIDIA Corporation

42 : float 64 NVIDIA Corporation : : : float 3M12MB 10,000 12, µs 357µs 3,494µs NVIDIA Corporation

43 : NVIDIA Corporation float3 global void accessfloat3(float3 *d_in, float3 d_out) { int index = blockidx.x * blockdim.x + threadidx.x; float3 a = d_in[index]; a.x += 2; a.y += 2; a.z += 2; } d_out[index] = a; NVIDIA Corporation

44 : float3 float sizeof(float3) B NVIDIA Corporation Float NVIDIA Corporation

45 : float3 sizeof(float3)*( /) ( / ) 3 : 0 ( /) 2*( /) float3 (float3*) ID NVIDIA Corporation float3 global void accessint3shared(float *g_in, float *g_out) { int index = 3 * blockidx.x * blockdim.x + threadidx.x; shared float s_data[256*3]; s_data[threadidx.x] d = g_ in[index]; s_data[threadidx.x+256] = g_in[index+256]; s_data[threadidx.x+512] = g_in[index+512]; syncthreads(); float3 a = ((float3*)s_data)[threadidx.x]; a.x += 2; a.y += 2; a.z += 2; } ((float3*)s )s_data)[threadidx.x] d = a; syncthreads(); g_out[index] = s_data[threadidx.x]; g_out[index+256] = s_data[threadidx.x+256]; g_out[index+512] = s_data[threadidx.x+512]; NVIDIA Corporation

46 : : : float 3M (12MB) 10,000 12, float 356µs 357µs 3,494µs 4, float3 3,302µs float3 359µs float3 NVIDIA Corporation : AoS Array of Structure: SoA Structure of Array: SoA : align(x)x = AoS SoA NVIDIA Corporation

47 : AoS SoA SoA : SDKAligned Types NVIDIA Corporation timestamp gld_incoherent gld_coherent gst_incoherent gst_coherent local_load local_store branch divergent_branch instructions warp_serialize cta_launched NVIDIA Corporation

48 CUDA_PROFILE : 1 0 CUDA_PROFILE_LOG :./cuda_profile.log CUDA_PROFILE_CSV : 1 0 CUDA_PROFILE_CONFIG : 4 config NVIDIA Corporation : 00 NVIDIA Corporation

49 Visual Profiler NVIDIA Corporation : NVIDIA Corporation

50 SDKMatrix Transpose NVIDIA Corporation NVIDIA Corporation

51 stride == 1 1:1 NVIDIA Corporation way stride == 2 8way stride == 8 NVIDIA Corporation

52 SDK warp_serialize : = NVIDIA Corporation : NVIDIA Corporation

53 CUDA CPU fetch NVIDIA Corporation NVIDIA Corporation

54 2 CUDA 1 CUDA CUDA float float NVIDIA Corporation CUDA CPU CUDA tex1dfetch() tex1d() tex2d() tex3d() NVIDIA Corporation

55 = NVIDIA Corporation

56 / 1 / > 2 1 syncthreads() ,000 NVIDIA Corporation RAW Read-After-Write 11 CUDA: PTX: x = y + 5; z = x + 3; s_data[0] += 3; add.f32 $f3, $f1, $f2 add.f32 $f5, $f3, $f4 ld.shared.f32 $f3, [$r31+0] add.f32 $f3, $f3, $f % NVIDIA Corporation

57 SM SM 8,192 SM 16KB ptxas-options=-v ncvv maxrregcount=n N = LMEM - LMEM NVIDIA Corporation cubin.cubin code architecture {sm_10} abiversion {0} modname {cubin} code { name = BlackScholesGPU lmem = 0 smem = 68 reg = 20 bar = 0 bincode { 0xa x x40024c09 0x NVIDIA Corporation

58 CUDA Occupancy Calculator NVIDIA Corporation == 1==1 : NVIDIA Corporation

59 != NVIDIA Corporation GPU GPU 1 : FFTW ATLAS Experiment NVIDIA Corporation

60 CUDA 1 : Tesla C GHz NVIDIA Corporation

61 NVIDIA Corporation int float add shift min max float mul mad: 14 int multiply (*) int multiply mul24() / umul24() 2 2 : n 2 foo % n == foo & (n-1) NVIDIA Corporation

62 sin cos116 : rcp() sin() exp() y / x == rcp(x) * y 120 sqrt(x) == x * rsqrt(x) 120 NVIDIA Corporation func(): ISA ISA : sin(x), exp(x), pow(x,y) func() : 5ulp : sin(x), exp(x), pow(x,y) -use_fast_math func() func() NVIDIA Corporation

63 GPUCPU : CPU 0.5ulp 80 NVIDIA Corporation (x+y)+z == x+(y+z) x = y = z = 1 GPU CUDA NVIDIA Corporation

64 G8x SSE IBMAltivec Cell SPE Format IEEE 754 IEEE 754 IEEE 754 IEEE 754 FADD FMUL inf -inf 1,000 1,000 Na log2(x) 2^x NVIDIA Corporation G8x IEEE 754 IEEE 0.5 ulp FMAD 2 ulp NVIDIA Corporation

65 float G8x float float f foo = bar * 0.123; // foo = bar * 0.123f; // float float foo = sin(bar); // foo = sinf(bar); // float NVIDIA Corporation ID if (threadidx.x > 2) { } if (threadidx.x / WARP_SIZE > 2) { } NVIDIA Corporation

66 GPU NVIDIA Corporation CUDA

67 CUDA 2 CUBLAS: BLAS CUFFT: FFT NVIDIA Corporation CUBLAS CUDA BLAS Basic Linear Algebra Subprograms: API CUDA GPU CUBLAS GPU CUBLAS GPU NVIDIA Corporation

68 BLAS 1 - O(N) 2 - O(N 2 ) 3 - O(N 3 ) 1 CGEMM BLAS CUBLAS NVIDIA Corporation CUBLAS CUBLAS cublas.h cublas + BLAS cublassgemm CUBLAS CUBLAS CUBLAS CCUDA CUDA C C++ NVIDIA Corporation

69 CUBLAS SGEMM NVIDIA Corporation cublasinit() cublasshutdown() cublasstatus cublasinit() CUBLAS GPU CUBLAS API cublasstatus cublasshutdown() CUBLAS CPU GPU NVIDIA Corporation

70 cublasgeterror() cublasalloc() cublasfree() cublasstatus cublasgeterror() CUBLAS CUBLAS_STATE_SUCCESS cublasstatus cublasalloc(int n, int elemsize, Void **devptr) ngpu elemsize cudamalloc()devptr devptr cublasstatus cublasfree(const void *devptr) GPUdevPtr NVIDIA Corporation cublassetvector() cublasgetvector() cublasstatus cublassetvector(int n, int elemsize, const void *x, int incx, void*y, int incy) CPUxn GPU y elemsize x y incx incy cublasstatus t cublasgetvector(int t t n, int elemsize, const void *x, int incx, void *y, int incy) GPUxn CPU y NVIDIA Corporation

71 cublassetmatrix() cublasgetmatrix() cublasstatus cublassetmatrix(int rows, int cols, int elemsize, const void *A, int lda, void *B, int ldb) CPUArows*cols GPU B elemsize A lda B ldb cublasstatus cublasgetmatrix(int rows, int cols, int elemsize, const void *A, int lda, void *B, int ldb) GPUArows*cols CPU B NVIDIA Corporation FORTRAN CUBLAS FortranC CUBLAS fortran.c f t NVIDIA Corporation

72 FORTRAN CUBLAS 2 fortran.c CUBLAS_USE_THUNKING GPU CPU GPU GPU CPU GPU CUBLAS CPU GPGPU BLAS GPGPU CUBLAS_ALLOC CUBLAS_FREE GPUCPUALLOC CUBLAS CUBLAS_SET_VECTOR CUBLAS_GET_VECTOR CUBLAS_SET_MATRIX CUBLAS_GET_MATRIX NVIDIA Corporation FORTRAN 77 program matrixmod implicit none integer M, N parameter (M=6, N=5) real*4 a(m,n) integer i, j do j = 1, N do i = 1, M a(i,j) = (i-1) * M + j enddo enddo call modify (a, M, N, 2, 3, 16.0, 12.0) subroutine modify (m, ldm, n, p, q, alpha, beta) implicit none integer ldm, n, p, q real*4 m(ldm,*), alpha, beta external sscal call sscal (n-p+1, alpha, m(p,q), ldm) call sscal (ldm-p+1, beta, m(p,q), 1) return end do j = 1, N do i = 1, M write(*,"(f7.0$)") a(i,j) enddo write (*,*)*) " enddo stop end NVIDIA Corporation

73 FORTRAN 77 : program matrixmod implicit none integer M, N, sizeof_real, devptra parameter (M=6, N=5, sizeof_real=4) real*4 a(m,n) integer i, j, stat external cublas_init, cublas_set_matrix,cublas_get_matrix external cublas_shutdown, cublas_alloc integer cublas_alloc do j = 1, N do i = 1, M a(i,j) = (i-1) * M + j enddo enddo call cublas_init stat = cublas_alloc(m*n, sizeof_real, devptra) if (stat.ne. 0) then write(*,*) "device memory allocation failed" stop endif call cublas_set_matrix (M, N, sizeof_real, a, M, devptra, M) call modify (devptra, M, N, 2, 3, 16.0, 12.0) call cublas_get_matrix (M, N, sizeof_real, devptra, M, a, M) call cublas_free(devptra) call cublas_shutdown do j = 1, N do i = 1, M write(*,"(f7.0$)") a(i,j) enddo write (*,*) " enddo stop end #define IDX2F(i,j,ld) ((((j)-1)*(ld))+((i)-1) subroutine modify (devptrm, ldm, n, p, q, alpha, beta) implicit none integer ldm, n, p, q integer sizeof_real, devptrm parameter (sizeof_real=4) real*4 alpha, beta call cublas_sscal (n-p+1, alpha, devptrm+idx2f(p,q,ldm)*sizeof_ real,ldm) call cublas_sscal (ldm-p+1, beta, devptrm+idx2f(p,q,ldm)*sizeof_ real,1) return end 72 NVIDIA Corporation CUFFT FFT Fast Fourier Transform: CUFFT CUDA FFT NVIDIA GPUFFT GPUFFT GPU NVIDIA Corporation

74 M 2D 3D[2,16384] NVIDIA Corporation CUFFT cuffthandle CUFFT cufftresults API CUFFT_SUCCESS CUFFT_INVALID_PLAN NVIDIA Corporation

75 CUFFT_C2C CUFFT_C2R CUFFT_R2C CUFFT_FORWARD (-1) CUFFT_BACKWARD (1) cufftcomplex FFT N -> N/2+1 N0 N1 Nn -> N0 N1 (Nn/2+1) NVIDIA Corporation D 3DCUFFT C FORTRAN MATLAB CUFFT IFFT(FFT(A))= length(a)*a CUFFT API FFTWFFT FFTGPU CUFFT NVIDIA Corporation

76 cufftplan1d() cufftresult cufftplan1d(cuffthandle *plan, int nx, cuffttype type, int batch) 1FFT batch1 CUFFT 1 CUFFT plan nx type batch plan cuffthandle 256 FFT256 CUFFT_C2C nx CUFFT 1 NVIDIA Corporation cufftplan2d() cufftresult cufftplan2d(cuffthandle *plan, int nx, int ny, cuffttype type) 2FFT plan nx ny type cuffthandle X Y CUFFT_C2C plan CUFFT 2 NVIDIA Corporation

77 cufftplan3d() cufftresult cufftplan3d(cuffthandle *plan, int nx, int ny, int nz, cuffttype type) 3FFT 3FFT plan nx ny nz type plan cuffthandle X Y Z CUFFT_C2C C2C CUFFT 3 NVIDIA Corporation cufftdestroy() cufftresult cufftdestroy(cuffthandle plan) CUFFT GPU GPU plan cuffthandle NVIDIA Corporation

78 cufftexecc2c() cufftresult cufftexecc2c(cuffthandle plan, cufftcomplex *idata, cufftcomplex *odata, int direction) CUFFT idata GPU odata idata odata plan cuffthandle idata GPUGPU odata GPU direction CUFFT_FORWARD CUFFT_BACKWARD odata NVIDIA Corporation cufftexecr2c() cufftresult cufftexecr2c(cuffthandle plan, cufftreal *idata, cufftcomplex *odata) CUFFT idata GPU odata idata odata plan cuffthandle idata GPUGPU odata GPU odata NVIDIA Corporation

79 cufftexecc2r() cufftresult cufftexecc2r(cuffthandle plan, cufftreal *idata, cufftcomplex *odata) CUFFT idata GPU GPU idata odata idata odata plan cuffthandle idata GPUGPU odata GPU odata NVIDIA Corporation CUFFT FFT 1. CUDA CUFFT CUFFTGPU 1 1 CUFFT 2FFT 1FFT CUFFT API NVIDIA Corporation

80 : 1 #define NX 256 #define BATCH 10 cuffthandle plan; cufftcomplex *data; cudamalloc((void**)&data, sizeof(cufftcomplex)*nx*batch); /* 1FFT */ cufftplan1d(&plan, NX, CUFFT_C2C, BATCH); /* CUFFT */ cufftexecc2c(plan, data, data, CUFFT_FORWARD); /* */ cufftexecc2c(plan, data, data, CUFFT_INVERSE); /* : (1) ) (2) */ /* CUFFT */ cufftdestroy(plan); cudafree(data); NVIDIA Corporation : 2 #define NX 256 #define NY 128 cuffthandle plan; cufftcomplex *idata, *odata; cudamalloc((void**)&idata, sizeof(cufftcomplex)*nx*ny); cudamalloc((void**)&odata, sizeof(cufftcomplex)*nx*ny); /* 1FFT */ cufftplan2d(&plan, NX,NY, CUFFT_C2C); /* CUFFT */ cufftexecc2c(plan, idata, odata, CUFFT_FORWARD); /* */ cufftexecc2c(plan, odata, odata, CUFFT_INVERSE); /* : */ /* CUFFT */ cufftdestroy(plan); cudafree(idata), cudafree(odata); NVIDIA Corporation

81 CUDA Fortran API NVIDIA Corporation

82 CUDA CUDA CUDA 2 2 CUDA NVIDIA Corporation

83 2 CUDA 1 CUDA CUDA 1 2 loat float NVIDIA Corporation CUDA CPU CUDA tex1dfetch() tex1d() tex2d() NVIDIA Corporation

84 : int float CUDA cudareadmodeelementtype cudareadmodenormalizedfloat 816int [-1,1][0,1] 0=[0, 1] cudafiltermodepoint cudafiltermodelinear cudaaddressmodeclamp cudaaddressmodewrap NVIDIA Corporation : // texture<unsigned short, 1, cudareadmodenormalizedfloat> texref;... // unsigned short *da = 0; cudamalloc((void**)&d_a, numbytes); cudamemcpy(da, ha, numbytes, cudamemcpyhosttodevice); // cudabindtexture(null, texref, da); NVIDIA Corporation

85 cudaarray cudachannelformatdesc int x y z w: enum cudachannelformatkind cudachannelformatkindsigned cudachannelformatkindunsigned cudachannelformatkindfloat cudacreatechanneldesc<float>(void); cudacreatechanneldesc<float4>(void); cudamallocarray cudafreearray cudamemcpytoarray cudamemcpyfromarray NVIDIA Corporation : 2 // texture<float, 2, cudareadmodeelementtype> texref;... // CUDA cudachannelformatdesc cf = cudacreatechanneldesc<float>(); cudaarray *texarray = 0; cudamallocarray(&texarray, &cf, dimx, dimy); cudamempcytoarray(texarray, 0,0, ha, numbytes, cudamemcpyhosttodevice); // texref.normalized = 0; texref.filtermode = cudafiltermodelinear; texref.addressmode = cudaaddressmodeclamp; // cudabindtexturetoarray(texref, texarray); NVIDIA Corporation

86 CUDA CUDA loat 816 cudareadmodenormalizedfloat API API API half f oat16 32 API CUDA NVIDIA Corporation CUDA Fortran

87 Fortran Fortran CUBLAS Fortranpinned Fortran CUDA NVIDIA Corporation SGEMM! 3A B C real, dimension(m1,m1):: A, B, C! #ifdef CUBLAS! CUBLASSGEMM CU! call cublas_sgemm ('n','n',m1,m1,m1,alpha,a,m1,b,m1,beta,c,m1) #else! BLASSGEMM call SGEMM ('n','n',m1,m1,m1,alpha,a,m1,b,m1,beta,c,m1) #endif BLAS g95 O3 code.f90 L/usr/local/lib lblas CUBLASfortran.c NVIDIA: gcc -O3 -DCUBLAS_USE_THUNKING -I/usr/local/cuda/include -c fortran.c g95 -O3 -DCUBLAS code.f90 fortran.o -L/usr/local/cuda/lib -lcublas NVIDIA Corporation

88 pinned pinned PCIe cudamallochost CFortran 2003 iso_ c_ binding! C C type (C_PTR) type(c_ptr) :: cptr_a, cptr_b, cptr_c! Fortran real, dimension(:,:), pointer :: A, B, C! cudamallochost! Fortraniso_c_binding!C(A(m1,m1)) res = cudamallochost ( cptr_a, m1*m1*sizeof(fp_kind) ) call c_f_pointer ( cptr_a, A, (/ m1, m1 /) )! A! cudamallochost NVIDIA Corporation CUDA FortranCUDA C! Fortran -> C -> CUDA ->C ->Fortran call cudafunction(c,c2,n) /* : Fortran */ extern "C" void cudafunction_(cucomplex *a, cucomplex *b, int *Np) {... int N=*np; cudamalloc ((void **) &a_d, sizeof(cucomplex)*n); cudamemcpy( a_d, a, sizeof(cucomplex)*n,cudamemcpyhosttodevice); dim3 dimblock(block_size); dim3 dimgrid (N/dimBlock.x); if( N % block_size!= 0 ) dimgrid.x+=1; square_complex<<<dimgrid,dimblock>>>(a_d,a_d,n); cudamemcpy( b, a_d, sizeof(cucomplex)*n,cudamemcpydevicetohost); cudafree(a_d); } complex_mul: main.f90 Cuda_function.o $(FC) -o complex_mul main.f90 Cuda_function.o -L/usr/local/cuda/lib lcudart Cuda_function.o: Cuda_function.cu nvcc -c -O3 Cuda_function.cu NVIDIA Corporation

89 CUDA API CUDA CUDA CUDA CUDACPU CUDA SDK asyncapi cudaevent_t start, stop; cudaeventcreate(&start); cudaeventcreate(&stop); cudaeventrecord(start, 0); kernel<<<grid, block>>>(...); cudaeventrecord(stop, 0); cudaeventsynchronize(stop); float et; cudaeventelapsedtime(&et, start, stop); cudaeventdestroy(start); cudaeventdestroy(stop); NVIDIA Corporation CPU GPU cudagetdevicecount( int* count ) cudasetdevice( int device ) cudagetdevice( int *current_device ) cudagetdeviceproperties( cudadeviceprop* prop, int device ) cudachoosedevice( int *device, cudadeviceprop* prop ) GPU 0 1CPU1GPU CPU GPU NVIDIA Corporation

90 CPU CUDA CPUCUDACPU CUDA CPU2 GPUp 3 CUDAp NVIDIA Corporation CUDA

91 OpenGL OpenGL CUDA Direct3D9 gldrawpixels / glteximage2d () NVIDIA Corporation OpenGL CUDA cudaglregisterbufferobject(gluint buffobj); OpenGL OpenGL CUDA cudaglmapbufferobject(void **devptr, GLuint buffobj); CUDA OpenGL cudaglunmapbufferobject(gluint buffobj); cudaglunregisterbufferobject(gluint buffobj); : OpenGL NVIDIA Corporation

92 : CUDA CUDAPBO CUDA unsigned char *p_d=0; cudaglmapbufferobject((void**)&p_d, pbo); preptexture<<<height,width>>>(p_d, time); cudaglunmapbufferobject(pbo); b glbindbuffer(gl_pixel_unpack_buffer_arb, pbo); glbindtexture(gl_texture_2d, texid); gltexsubimage2d(gl_texture_2d, 0, 0,0, 256,256, GL_BGRA, GL_UNSIGNED_BYTE, 0); NVIDIA Corporation : CUDA OpenGL PBO CUDA PBO CUDA CUDAPBO unsigned char *p_d=0; cudaglregisterbufferobject(pbo); cudaglmapbufferobject((void**)&p_d, pbo); postprocess<<<blocks,threads>>>(p_d); cudaglunmapbufferobject(pbo); cudaglunregisterbufferobject(pbo);... NVIDIA Corporation

93

94 NVIDIA NVIDIA NVIDIA Corporation NVIDIA Corporation NVIDIA Corporation NVIDIA Corporation NVIDIA NVIDIA CUDA Tesla NVIDIA Corporation Copyright 2008 NVIDIA Corporation.All rights reserved. NVIDIA Corporation 2701 San Tomas Expressway Santa Clara, CA

untitled

untitled GPGPU NVIDACUDA Learn More about CUDA - NVIDIA http://www.nvidia.co.jp/object/cuda_education_jp.html NVIDIA CUDA programming Guide CUDA http://www.sintef.no/upload/ikt/9011/simoslo/evita/2008/seland.pdf

More information

Slide 1

Slide 1 CUDA プログラミングの基本 パート II - カーネル CUDA の基本の概要 パート I CUDAのソフトウェアスタックとコンパイル GPUのメモリ管理 パート II カーネルの起動 GPUコードの具体像 注 : 取り上げているのは基本事項のみです そのほか多数の API 関数についてはプログラミングガイドを ご覧ください GPU 上でのコードの実行 カーネルは C 関数 + 多少の制約 ホストメモリはアクセスできない戻り値型は

More information

07-二村幸孝・出口大輔.indd

07-二村幸孝・出口大輔.indd GPU Graphics Processing Units HPC High Performance Computing GPU GPGPU General-Purpose computation on GPU CPU GPU GPU *1 Intel Quad-Core Xeon E5472 3.0 GHz 2 6 MB L2 cache 1600 MHz FSB 80 GFlops 1 nvidia

More information

Slide 1

Slide 1 CUDA プログラミングの基本 パート I - ソフトウェアスタックとメモリ管理 CUDA の基本の概要 パート I CUDAのソフトウェアスタックとコンパイル GPUのメモリ管理 パートII カーネルの起動 GPUコードの具体項目 注 : 取り上げているのは基本事項のみです そのほか多数の API 関数についてはプログラミングガイドを ご覧ください CUDA インストレーション CUDA インストレーションの構成

More information

( CUDA CUDA CUDA CUDA ( NVIDIA CUDA I

(    CUDA CUDA CUDA CUDA (  NVIDIA CUDA I GPGPU (II) GPGPU CUDA 1 GPGPU CUDA(CUDA Unified Device Architecture) CUDA NVIDIA GPU *1 C/C++ (nvcc) CUDA NVIDIA GPU GPU CUDA CUDA 1 CUDA CUDA 2 CUDA NVIDIA GPU PC Windows Linux MaxOSX CUDA GPU CUDA NVIDIA

More information

1. GPU コンピューティング GPU コンピューティング GPUによる 汎用コンピューティング GPU = Graphics Processing Unit CUDA Compute Unified Device Architecture NVIDIA の GPU コンピューティング環境 Lin

1. GPU コンピューティング GPU コンピューティング GPUによる 汎用コンピューティング GPU = Graphics Processing Unit CUDA Compute Unified Device Architecture NVIDIA の GPU コンピューティング環境 Lin Windows で始める CUDA 入門 GTC 2013 チュートリアル エヌビディアジャパン CUDA エンジニア森野慎也 1. GPU コンピューティング GPU コンピューティング GPUによる 汎用コンピューティング GPU = Graphics Processing Unit CUDA Compute Unified Device Architecture NVIDIA の GPU コンピューティング環境

More information

GPU CUDA CUDA 2010/06/28 1

GPU CUDA CUDA 2010/06/28 1 GPU CUDA CUDA 2010/06/28 1 GPU NVIDIA Mark Harris, Optimizing Parallel Reduction in CUDA http://developer.download.nvidia.com/ compute/cuda/1_1/website/data- Parallel_Algorithms.html#reduction CUDA SDK

More information

CUDA 連携とライブラリの活用 2

CUDA 連携とライブラリの活用 2 1 09:30-10:00 受付 10:00-12:00 Reedbush-H ログイン GPU 入門 13:30-15:00 OpenACC 入門 15:15-16:45 OpenACC 最適化入門と演習 17:00-18:00 OpenACC の活用 (CUDA 連携とライブラリの活用 ) CUDA 連携とライブラリの活用 2 3 OpenACC 簡単にGPUプログラムが作成できる それなりの性能が得られる

More information

CUDA基礎1

CUDA基礎1 CUDA 基礎 1 東京工業大学 学術国際情報センター 黄遠雄 2016/6/27 第 20 回 GPU コンピューティング講習会 1 ヘテロジニアス コンピューティング ヘテロジニアス コンピューティング (CPU + GPU) は広く使われている Financial Analysis Scientific Simulation Engineering Simulation Data Intensive

More information

1 4 1.1........................................... 4 1.2.................................. 4 1.3................................... 4 2 5 2.1 GPU.....

1 4 1.1........................................... 4 1.2.................................. 4 1.3................................... 4 2 5 2.1 GPU..... CPU GPU N Q07-065 2011 2 17 1 1 4 1.1........................................... 4 1.2.................................. 4 1.3................................... 4 2 5 2.1 GPU...........................................

More information

untitled

untitled CUDA Vol II: CUDA : NVIDIA Q2 2008 CUDA...1 CUDA...3 CUDA...16...40...63 CUDA CUDA ( ) CUDA 2 NVIDIA Corporation 2008 2 CUDA CUDA GPU GPU CPU NVIDIA Corporation 2008 4 V V d call put 1 2 = S CND( d ) X

More information

概要 目的 CUDA Fortran の利用に関する基本的なノウハウを提供する 本チュートリアル受講後は Web 上で公開されている資料等を参照しながら独力で CUDA Fortran が利用できることが目標 対象 CUDA Fortran の利用に興味を抱いている方 前提とする知識 Fortran

概要 目的 CUDA Fortran の利用に関する基本的なノウハウを提供する 本チュートリアル受講後は Web 上で公開されている資料等を参照しながら独力で CUDA Fortran が利用できることが目標 対象 CUDA Fortran の利用に興味を抱いている方 前提とする知識 Fortran CUDA Fortran チュートリアル 2010 年 9 月 29 日 NEC 概要 目的 CUDA Fortran の利用に関する基本的なノウハウを提供する 本チュートリアル受講後は Web 上で公開されている資料等を参照しながら独力で CUDA Fortran が利用できることが目標 対象 CUDA Fortran の利用に興味を抱いている方 前提とする知識 Fortran を用いた Linux

More information

CUDA を用いた画像処理 画像処理を CUDA で並列化 基本的な並列化の考え方 目標 : 妥当な Naïve コードが書ける 最適化の初歩がわかる ブロックサイズ メモリアクセスパターン

CUDA を用いた画像処理 画像処理を CUDA で並列化 基本的な並列化の考え方 目標 : 妥当な Naïve コードが書ける 最適化の初歩がわかる ブロックサイズ メモリアクセスパターン CUDA 画像処理入門 エヌビディアジャパン CUDA エンジニア森野慎也 GTC Japan 2014 CUDA を用いた画像処理 画像処理を CUDA で並列化 基本的な並列化の考え方 目標 : 妥当な Naïve コードが書ける 最適化の初歩がわかる ブロックサイズ メモリアクセスパターン RGB Y( 輝度 ) 変換 カラー画像から グレイスケールへの変換 Y = 0.299 R + 0.587

More information

NUMAの構成

NUMAの構成 GPU のプログラム 天野 アクセラレータとは? 特定の性質のプログラムを高速化するプロセッサ 典型的なアクセラレータ GPU(Graphic Processing Unit) Xeon Phi FPGA(Field Programmable Gate Array) 最近出て来た Deep Learning 用ニューロチップなど Domain Specific Architecture 1GPGPU:General

More information

untitled

untitled A = QΛQ T A n n Λ Q A = XΛX 1 A n n Λ X GPGPU A 3 T Q T AQ = T (Q: ) T u i = λ i u i T {λ i } {u i } QR MR 3 v i = Q u i A {v i } A n = 9000 Quad Core Xeon 2 LAPACK (4/3) n 3 O(n 2 ) O(n 3 ) A {v i }

More information

TSUBAME2.0におけるGPUの 活用方法

TSUBAME2.0におけるGPUの 活用方法 GPU プログラミング 基礎編 東京工業大学学術国際情報センター 1. GPU コンピューティングと TSUBAME2.0 スーパーコンピュータ GPU コンピューティングとは グラフィックプロセッサ (GPU) は グラフィック ゲームの画像計算のために 進化を続けてきた 現在 CPU のコア数は 2~12 個に対し GPU 中には数百コア その GPU を一般アプリケーションの高速化に利用! GPGPU

More information

1. マシンビジョンにおける GPU の活用

1. マシンビジョンにおける GPU の活用 CUDA 画像処理入門 GTC 213 チュートリアル エヌビディアジャパン CUDA エンジニア森野慎也 1. マシンビジョンにおける GPU の活用 1. 医用画像処理における GPU の活用 CT や MRI から画像を受信して三次元画像の構築をするシステム 2 次元スキャンデータから 3 次元 4 次元イメージの高速生成 CUDA 化により画像処理速度を約 2 倍に高速化 1. CUDA で画像処理

More information

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎)

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎) GPU コンピューティング (CUDA) 講習会 CUDA によるプログラミング基礎 丸山直也 2009/10/28 1 はじめに 本講習会では時間の関係上ごくごく基礎的なことのみをとりあげます ただし 資料の後半にはメモリアクセスなどに関するチューニングに向けた情報をのせてあります それらは講習時間内には取り上げません チューニングやよりアドバンストな内容の講習会は今後 ( 基礎編の需要が一段落してから

More information

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎)

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎) GPU コンピューティング (CUDA) 講習会 CUDA によるプログラミング基礎 丸山直也 2009/11/25 1 はじめに 本講習では時間の関係上ごくごく基礎的な内容のみをとりあげます ただし 資料の後半にはメモリアクセスなどに関するチューニングに向けた情報をのせてあります それらは講習時間内には取り上げません チューニングやよりアドバンストな内容の講習会は今後 ( 基礎編の需要が一段落してから

More information

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎)

TSUBAMEのTeslaを用いたGPGPU(CUDAの基礎) GPU コンピューティング (CUDA) 講習会 CUDA プログラミング基礎 丸山直也 2010/09/13 1 はじめに 本講習では時間の関係上ごくごく基礎的な内容のみをとりあげます ただし 資料の後半にはメモリアクセスなどに関するチューニングに向けた情報をのせてあります それらは講習時間内には取り上げません チューニングやよりアドバンストな内容の講習会は別途開催しております 本講習で取り上げる概念等は基礎的なものに限られるため

More information

GPU 画像 動画処理用ハードウェア 低性能なプロセッサがたくさん詰まっている ピーク性能が非常に高い GPUを数値計算に用いるのがGPGPU Graphics Processing Unit General Purpose GPU TSUBAME2.0: GPUスパコン 本演習ではNVIDIA社の

GPU 画像 動画処理用ハードウェア 低性能なプロセッサがたくさん詰まっている ピーク性能が非常に高い GPUを数値計算に用いるのがGPGPU Graphics Processing Unit General Purpose GPU TSUBAME2.0: GPUスパコン 本演習ではNVIDIA社の 演習II (連続系アルゴリズム) 第2回: GPGPU 須田研究室 M1 本谷 徹 motoya@is.s.u-tokyo.ac.jp 2012/10/19 GPU 画像 動画処理用ハードウェア 低性能なプロセッサがたくさん詰まっている ピーク性能が非常に高い GPUを数値計算に用いるのがGPGPU Graphics Processing Unit General Purpose GPU TSUBAME2.0:

More information

untitled

untitled A = QΛQ T A n n Λ Q A = XΛX 1 A n n Λ X GPGPU A 3 T Q T AQ = T (Q: ) T u i = λ i u i T {λ i } {u i } QR MR 3 v i = Q u i A {v i } A n = 9000 Quad Core Xeon 2 LAPACK (4/3) n 3 O(n 2 ) O(n 3 ) A {v i }

More information

CPU Levels in the memory hierarchy Level 1 Level 2... Increasing distance from the CPU in access time Level n Size of the memory at each level 1: 2.2

CPU Levels in the memory hierarchy Level 1 Level 2... Increasing distance from the CPU in access time Level n Size of the memory at each level 1: 2.2 FFT 1 Fourier fast Fourier transform FFT FFT FFT 1 FFT FFT 2 Fourier 2.1 Fourier FFT Fourier discrete Fourier transform DFT DFT n 1 y k = j=0 x j ω jk n, 0 k n 1 (1) x j y k ω n = e 2πi/n i = 1 (1) n DFT

More information

CudaWaveField

CudaWaveField CudaWaveField 2012 3 22 2 CudaWaveField Rel 1.0.0 Rel 1.0 CudaWaveField ( cwfl) / cwfl cwfl http://www.laser.ee.kansai-u.ac.jp/wavefieldtools Note Acrobat Reader 3 I CudaWaveField 9 1 11 1.1 CudaWaveField......................

More information

DO 時間積分 START 反変速度の計算 contravariant_velocity 移流項の計算 advection_adams_bashforth_2nd DO implicit loop( 陰解法 ) 速度勾配, 温度勾配の計算 gradient_cell_center_surface 速

DO 時間積分 START 反変速度の計算 contravariant_velocity 移流項の計算 advection_adams_bashforth_2nd DO implicit loop( 陰解法 ) 速度勾配, 温度勾配の計算 gradient_cell_center_surface 速 1 1, 2 1, 2 3 2, 3 4 GP LES ASUCA LES NVIDIA CUDA LES 1. Graphics Processing Unit GP General-Purpose SIMT Single Instruction Multiple Threads 1 2 3 4 1),2) LES Large Eddy Simulation 3) ASUCA 4) LES LES

More information

! 行行 CPUDSP PPESPECell/B.E. CPUGPU 行行 SIMD [SSE, AltiVec] 用 HPC CPUDSP PPESPE (Cell/B.E.) SPE CPUGPU GPU CPU DSP DSP PPE SPE SPE CPU DSP SPE 2

! 行行 CPUDSP PPESPECell/B.E. CPUGPU 行行 SIMD [SSE, AltiVec] 用 HPC CPUDSP PPESPE (Cell/B.E.) SPE CPUGPU GPU CPU DSP DSP PPE SPE SPE CPU DSP SPE 2 ! OpenCL [Open Computing Language] 言 [OpenCL C 言 ] CPU, GPU, Cell/B.E.,DSP 言 行行 [OpenCL Runtime] OpenCL C 言 API Khronos OpenCL Working Group AMD Broadcom Blizzard Apple ARM Codeplay Electronic Arts Freescale

More information

Microsoft PowerPoint - suda.pptx

Microsoft PowerPoint - suda.pptx GPU の HWアーキテクチャと高性能化手法 須田礼仁 ( 東京大学 ) 2011/03/22 GPU 高性能プログラミング GPU のハードウェアを理解する CUDA のソフトウェアを理解する CUDA でプログラムを書くのは難しくないが, CUDA で高速なプログラムを書くのは難しい どうすれば遅くなるかを理解する! 効果が大きいものから順に説明します 1 高性能プログラミングの手順 1. 現在のコードの,

More information

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド Visual Fortran Composer XE 2013 Windows* エクセルソフト株式会社 www.xlsoft.com Rev. 1.1 (2012/12/10) Copyright 1998-2013 XLsoft Corporation. All Rights Reserved. 1 / 53 ... 3... 4... 4... 5 Visual Studio... 9...

More information

GPU GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1

GPU GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1 GPU 4 2010 8 28 1 GPU CPU CPU CPU GPU GPU N N CPU ( ) 1 GPU CPU GPU 2D 3D CPU GPU GPU GPGPU GPGPU 2 nvidia GPU CUDA 3 GPU 3.1 GPU Core 1 Register & Shared Memory ( ) CPU CPU(Intel Core i7 965) GPU(Tesla

More information

Microsoft PowerPoint - GPGPU実践基礎工学(web).pptx

Microsoft PowerPoint - GPGPU実践基礎工学(web).pptx GPU のプログラム構造 長岡技術科学大学電気電子情報工学専攻出川智啓 今回の内容 GPU プログラミング環境 (CUDA) GPU プログラムの実行の流れ CUDA によるプログラムの記述 カーネル (GPU で処理する関数 ) の構造 記述方法とその理由 GPU 固有のパラメータの確認 405 GPU(Graphics Processing Unit) とは 画像処理専用のハードウェア 具体的には画像処理用のチップ

More information

IPSJ SIG Technical Report Vol.2013-HPC-138 No /2/21 GPU CRS 1,a) 2,b) SpMV GPU CRS SpMV GPU NVIDIA Kepler CUDA5.0 Fermi GPU Kepler Kepler Tesla

IPSJ SIG Technical Report Vol.2013-HPC-138 No /2/21 GPU CRS 1,a) 2,b) SpMV GPU CRS SpMV GPU NVIDIA Kepler CUDA5.0 Fermi GPU Kepler Kepler Tesla GPU CRS 1,a),b) SpMV GPU CRS SpMV GPU NVIDIA Kepler CUDA5.0 Fermi GPU Kepler Kepler Tesla K0 CUDA5.0 cusparse CRS SpMV 00 1.86 177 1. SpMV SpMV CRS Compressed Row Storage *1 SpMV GPU GPU NVIDIA Kepler

More information

01_OpenMP_osx.indd

01_OpenMP_osx.indd OpenMP* / 1 1... 2 2... 3 3... 5 4... 7 5... 9 5.1... 9 5.2 OpenMP* API... 13 6... 17 7... 19 / 4 1 2 C/C++ OpenMP* 3 Fortran OpenMP* 4 PC 1 1 9.0 Linux* Windows* Xeon Itanium OS 1 2 2 WEB OS OS OS 1 OS

More information

Slides: TimeGraph: GPU Scheduling for Real-Time Multi-Tasking Environments

Slides: TimeGraph: GPU Scheduling for Real-Time Multi-Tasking Environments 計算機アーキテクチャ第 11 回 マルチプロセッサ 本資料は授業用です 無断で転載することを禁じます 名古屋大学 大学院情報科学研究科 准教授加藤真平 デスクトップ ジョブレベル並列性 スーパーコンピュータ 並列処理プログラム プログラムの並列化 for (i = 0; i < N; i++) { x[i] = a[i] + b[i]; } プログラムの並列化 x[0] = a[0] + b[0];

More information

GPGPUによる高速画像処理

GPGPUによる高速画像処理 GPGPU による高速画像処理 ~ リアルタイム画像処理への挑戦 ~ 名古屋大学大学院情報科学研究科 出口大輔 リアルタイム画像処理 2 3 発表の流れ GPGPU を始める前に GPGPU の基礎知識 CUDA の使い方 CUDA を使う前に プログラミングの予備知識 CUDA を使って Hello World GPGPU にチャレンジ 行列積の計算 テンプレートマッチング ガウシアンフィルタ SIFT

More information

インテル(R) Visual Fortran Composer XE

インテル(R) Visual Fortran Composer XE Visual Fortran Composer XE 1. 2. 3. 4. 5. Visual Studio 6. Visual Studio 7. 8. Compaq Visual Fortran 9. Visual Studio 10. 2 https://registrationcenter.intel.com/regcenter/ w_fcompxe_all_jp_2013_sp1.1.139.exe

More information

WinDriver PCI Quick Start Guide

WinDriver PCI Quick Start Guide WinDriver PCI/PCI Express/PCMCIA 5! WinDriver (1) DriverWizard (2) DriverWizard WinDriver (1) Windows 98/Me/2000/XP/Server 2003/Vista Windows CE.NET Windows Embedded CE v6.00 Windows Mobile 5.0/6.0 Linux

More information

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

Minsky の電力消費量の調査 (1) ディープラーニングデモプログラム (mnist) の実行デモプログラム 添付 1 CPU 実行 シングル GPU 実行 2GPU 実行での計算時間と電力消費量を比較した 〇計算時間 CPU 実行 シングル GPU 実行複数 GPU 実行 今回は 2GPU 計

Minsky の電力消費量の調査 (1) ディープラーニングデモプログラム (mnist) の実行デモプログラム 添付 1 CPU 実行 シングル GPU 実行 2GPU 実行での計算時間と電力消費量を比較した 〇計算時間 CPU 実行 シングル GPU 実行複数 GPU 実行 今回は 2GPU 計 IBM Minsky における 電力性能比検証報告書 (Deep Learning および HPC アプリケーション ) 2017 年 1 月 ビジュアルテクノロジー株式会社 Minsky の電力消費量の調査 (1) ディープラーニングデモプログラム (mnist) の実行デモプログラム 添付 1 CPU 実行 シングル GPU 実行 2GPU 実行での計算時間と電力消費量を比較した 〇計算時間 CPU

More information

11050427-0_Vol16No3.indd

11050427-0_Vol16No3.indd 2599 チュートリアル BLAS, LAPACK 2 2 GPU BLAS, LAPACKチュートリアル パート2 (GPU 編 ) 中 田 真 秀 1 はじめに GPU Graphics Processing Unit BLAS, LAPACK GPU GPU NVIDIA AMD AMD RADEON HD NVIDIA NVIDIA GPU NVIDIA C2050 BLAS, LAPACK

More information

Excel97関数編

Excel97関数編 Excel97 SUM Microsoft Excel 97... 1... 1... 1... 2... 3... 3... 4... 5... 6... 6... 7 SUM... 8... 11 Microsoft Excel 97 AVERAGE MIN MAX SUM IF 2 RANK TODAY ROUND COUNT INT VLOOKUP 1/15 Excel A B C A B

More information

2011 年 3 月 3 日 GPGPU ハンズオンプログラミング演習 株式会社クロスアビリティ ability.jp 3 Mar 2011 Copyright (C) 2011 X-Ability Co.,Ltd. All rights reserved.

2011 年 3 月 3 日 GPGPU ハンズオンプログラミング演習 株式会社クロスアビリティ ability.jp 3 Mar 2011 Copyright (C) 2011 X-Ability Co.,Ltd. All rights reserved. 2011 年 3 月 3 日 GPGPU ハンズオンプログラミング演習 株式会社クロスアビリティ rkoga@x ability.jp 講師 : 古賀良太 / 古川祐貴 取締役計算化学ソルバー XA CHEM SUITE の開発 コンサルティングパートナー 並列ソフトウェアの開発 ビルド サーバ販売 ソフトウェア代理店 会社紹介 社名株式会社クロスアビリティ (X Ability Co.,Ltd)

More information

11042 計算機言語7回目 サポートページ:

11042 計算機言語7回目  サポートページ: 11042 7 :https://goo.gl/678wgm November 27, 2017 10/2 1(print, ) 10/16 2(2, ) 10/23 (3 ) 10/31( ),11/6 (4 ) 11/13,, 1 (5 6 ) 11/20,, 2 (5 6 ) 11/27 (7 12/4 (9 ) 12/11 1 (10 ) 12/18 2 (10 ) 12/25 3 (11

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

ストリーミング SIMD 拡張命令2 (SSE2) を使用した SAXPY/DAXPY

ストリーミング SIMD 拡張命令2 (SSE2) を使用した SAXPY/DAXPY SIMD 2(SSE2) SAXPY/DAXPY 2.0 2000 7 : 248600J-001 01/12/06 1 305-8603 115 Fax: 0120-47-8832 * Copyright Intel Corporation 1999, 2000 01/12/06 2 1...5 2 SAXPY DAXPY...5 2.1 SAXPY DAXPY...6 2.1.1 SIMD C++...6

More information

Microsoft Word - paper.docx

Microsoft Word - paper.docx による高速画像処理 名古屋大学大学院情報科学研究科出口大輔, 井手一郎, 村瀬洋 概要 : 本発表では, 近年注目を集めている GP(General Purpose computing on s) の技術に着目し,GP を利用するための開発環境の使い方やプログラミングのノウハウを分かりやすく解説する. GP は を汎用計算に利用しようという試みであり, 現在では物理シミュレーション, 数値計算, 信号解析,

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

ストリームを用いたコンカレントカーネルプログラミングと最適化 エヌビディアジャパン CUDAエンジニア森野慎也 GTC Japan 2014

ストリームを用いたコンカレントカーネルプログラミングと最適化 エヌビディアジャパン CUDAエンジニア森野慎也 GTC Japan 2014 ストリームを用いたコンカレントカーネルプログラミングと最適化 エヌビディアジャパン CUDAエンジニア森野慎也 GTC Japan 2014 コンカレントな処理の実行 システム内部の複数の処理を 平行に実行する CPU GPU メモリ転送 カーネル実行 複数のカーネル間 ストリーム GPU 上の処理キュー カーネル実行 メモリ転送の並列性 実行順序 DEFAULT STREAM Stream : GPU

More information

いまからはじめる組み込みGPU実装

いまからはじめる組み込みGPU実装 いまからはじめる組み込み GPU 実装 ~ コンピュータービジョン ディープラーニング編 ~ MathWorks Japan アプリケーションエンジニアリング部シニアアプリケーションエンジニア大塚慶太郎 2017 The MathWorks, Inc. 1 コンピュータービジョン ディープラーニングによる 様々な可能性 自動運転 ロボティクス 予知保全 ( 製造設備 ) セキュリティ 2 転移学習を使った画像分類

More information

1 OpenCL OpenCL 1 OpenCL GPU ( ) 1 OpenCL Compute Units Elements OpenCL OpenCL SPMD (Single-Program, Multiple-Data) SPMD OpenCL work-item work-group N

1 OpenCL OpenCL 1 OpenCL GPU ( ) 1 OpenCL Compute Units Elements OpenCL OpenCL SPMD (Single-Program, Multiple-Data) SPMD OpenCL work-item work-group N GPU 1 1 2 1, 3 2, 3 (Graphics Unit: GPU) GPU GPU GPU Evaluation of GPU Computing Based on An Automatic Program Generation Technology Makoto Sugawara, 1 Katsuto Sato, 1 Kazuhiko Komatsu, 2 Hiroyuki Takizawa

More information

Microsoft PowerPoint _OpenCAE並列計算分科会.pptx

Microsoft PowerPoint _OpenCAE並列計算分科会.pptx 地球流体力学に関する GPGPU を用いた数値計算 神戸大学惑星科学研究センター西澤誠也 地球流体力学とは 地球 惑星に関連がある流体の力学 回転, 重力の影響 e.g. 大気, 海洋, マントル 数値計算は天気予報 & 弾道軌道予測から始まった ベクトル計算機 地球流体の計算はベクトル長が長いものが多い ベクトル計算機の凋落 某社の次世代スパコンからの撤退 個人的スパコンの将来予想 個々の演算器はシンプルに

More information

MPI または CUDA を用いた将棋評価関数学習プログラムの並列化 2009/06/30

MPI または CUDA を用いた将棋評価関数学習プログラムの並列化 2009/06/30 MPI または CUDA を用いた将棋評価関数学習プログラムの並列化 2009/06/30 目次 1. まえがき 3 2. 計算方法 4 3. MPI を用いた並列化 6 4. CUDA を用いた並列化 11 5. 計算結果 20 6. まとめ 24 2 1. まえがき 目的将棋の評価関数を棋譜から学習するボナンザメソッドの簡易版を作成し それを MPI または CUDA を用いて並列化し 計算時間を短縮することを目的とする

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

Fortran90/95 [9]! (1 ) " " 5 "Hello!"! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1

Fortran90/95 [9]! (1 )   5 Hello!! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1 Fortran90/95 2.1 Fortran 2-1 Hello! 1 program example2_01! end program 2! first test program ( ) 3 implicit none! 4 5 write(*,*) "Hello!"! write Hello! 6 7 stop! 8 end program example2_01 1 program 1!

More information

3次多項式パラメタ推定計算の CUDAを用いた実装 (CUDAプログラミングの練習として) Implementation of the Estimation of the parameters of 3rd-order-Polynomial with CUDA

3次多項式パラメタ推定計算の CUDAを用いた実装 (CUDAプログラミングの練習として)  Implementation of the Estimation of the parameters of 3rd-order-Polynomial with CUDA 3 次多項式パラメタ推定計算の CUDA を用いた実装 (CUDA プログラミングの練習として ) Estimating the Parameters of 3rd-order-Polynomial with CUDA ISS 09/11/12 問題の選択 目的 CUDA プログラミングを経験 ( 試行錯誤と習得 ) 実際に CPU のみの場合と比べて高速化されることを体験 問題 ( インプリメントする内容

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

1 OpenCL Work-Item Private Memory Workgroup Local Memory Compute Device Global/Constant Memory Host Host Memory OpenCL CUDA CUDA Compute Unit MP Proce

1 OpenCL Work-Item Private Memory Workgroup Local Memory Compute Device Global/Constant Memory Host Host Memory OpenCL CUDA CUDA Compute Unit MP Proce GPGPU (VI) GPGPU 1 GPGPU CUDA CUDA GPGPU GPGPU CUDA GPGPU ( ) CUDA GPGPU 2 OpenCL OpenCL GPGPU Apple Khronos Group OpenCL Working Group [1] CUDA GPU NVIDIA GPU *1 OpenCL NVIDIA AMD GPU CPU DSP(Digital

More information

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 (Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 17 Fortran Formular Tranlator Lapack Fortran FORTRAN, FORTRAN66, FORTRAN77, FORTRAN90, FORTRAN95 17.1 A Z ( ) 0 9, _, =, +, -, *,

More information

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a))

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) E-mail: {nanri,amano}@cc.kyushu-u.ac.jp 1 ( ) 1. VPP Fortran[6] HPF[3] VPP Fortran 2. MPI[5]

More information

GPU のアーキテクチャとプログラム構造 長岡技術科学大学電気電子情報工学専攻出川智啓

GPU のアーキテクチャとプログラム構造 長岡技術科学大学電気電子情報工学専攻出川智啓 GPU のアーキテクチャとプログラム構造 長岡技術科学大学電気電子情報工学専攻出川智啓 今回の内容 GPU のアーキテクチャ CUDA CUDA によるプログラミング 58 GPU(Graphics Processing Unit) とは 画像処理専用のハードウェア 具体的には画像処理用のチップ チップ単体では販売されていない PCI Ex カードで販売 ( チップ単体と区別せずに GPU と呼ぶことも多い

More information

倍々精度RgemmのnVidia C2050上への実装と応用

倍々精度RgemmのnVidia C2050上への実装と応用 .. maho@riken.jp http://accc.riken.jp/maho/,,, 2011/2/16 1 - : GPU : SDPA-DD 10 1 - Rgemm : 4 (32 ) nvidia C2050, GPU CPU 150, 24GFlops 25 20 GFLOPS 15 10 QuadAdd Cray, QuadMul Sloppy Kernel QuadAdd Cray,

More information

untitled

untitled Fortran90 ( ) 17 12 29 1 Fortran90 Fortran90 FORTRAN77 Fortran90 1 Fortran90 module 1.1 Windows Windows UNIX Cygwin (http://www.cygwin.com) C\: Install Cygwin f77 emacs latex ps2eps dvips Fortran90 Intel

More information

. (.8.). t + t m ü(t + t) + c u(t + t) + k u(t + t) = f(t + t) () m ü f. () c u k u t + t u Taylor t 3 u(t + t) = u(t) + t! u(t) + ( t)! = u(t) + t u(

. (.8.). t + t m ü(t + t) + c u(t + t) + k u(t + t) = f(t + t) () m ü f. () c u k u t + t u Taylor t 3 u(t + t) = u(t) + t! u(t) + ( t)! = u(t) + t u( 3 8. (.8.)............................................................................................3.............................................4 Nermark β..........................................

More information

Microsoft PowerPoint - GPU_computing_2013_01.pptx

Microsoft PowerPoint - GPU_computing_2013_01.pptx GPU コンピューティン No.1 導入 東京工業大学 学術国際情報センター 青木尊之 1 GPU とは 2 GPGPU (General-purpose computing on graphics processing units) GPU を画像処理以外の一般的計算に使う GPU の魅力 高性能 : ハイエンド GPU はピーク 4 TFLOPS 超 手軽さ : 普通の PC にも装着できる 低価格

More information

211 年ハイパフォーマンスコンピューティングと計算科学シンポジウム Computing Symposium 211 HPCS /1/18 a a 1 a 2 a 3 a a GPU Graphics Processing Unit GPU CPU GPU GPGPU G

211 年ハイパフォーマンスコンピューティングと計算科学シンポジウム Computing Symposium 211 HPCS /1/18 a a 1 a 2 a 3 a a GPU Graphics Processing Unit GPU CPU GPU GPGPU G 211 年ハイパフォーマンスコンピューティングと計算科学シンポジウム Computing Symposium 211 HPCS211 211/1/18 GPU 4 8 BLAS 4 8 BLAS Basic Linear Algebra Subprograms GPU Graphics Processing Unit 4 8 double 2 4 double-double DD 4 4 8 quad-double

More information

1 GPU GPGPU GPU CPU 2 GPU 2007 NVIDIA GPGPU CUDA[3] GPGPU CUDA GPGPU CUDA GPGPU GPU GPU GPU Graphics Processing Unit LSI LSI CPU ( ) DRAM GPU LSI GPU

1 GPU GPGPU GPU CPU 2 GPU 2007 NVIDIA GPGPU CUDA[3] GPGPU CUDA GPGPU CUDA GPGPU GPU GPU GPU Graphics Processing Unit LSI LSI CPU ( ) DRAM GPU LSI GPU GPGPU (I) GPU GPGPU 1 GPU(Graphics Processing Unit) GPU GPGPU(General-Purpose computing on GPUs) GPU GPGPU GPU ( PC ) PC PC GPU PC PC GPU GPU 2008 TSUBAME NVIDIA GPU(Tesla S1070) TOP500 29 [1] 2009 AMD

More information

3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,.,

3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,., B:,, 2017 12 1, 8, 15, 22 1,.,,,,.,.,,,., 1,. 1. :, ν. 2. : u t = ν 2 u x 2, (1), c. u t + c u x = 0, (2), ( ). 1 3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2,

More information

(MIRU2010) NTT Graphic Processor Unit GPU graphi

(MIRU2010) NTT Graphic Processor Unit GPU graphi (MIRU2010) 2010 7 889 2192 1-1 905 2171 905 NTT 243 0124 3-1 E-mail: ac094608@edu.okinawa-ct.ac.jp, akisato@ieee.org Graphic Processor Unit GPU graphic processor unit CUDA Fully automatic extraction of

More information

TSUBAME2.0 における GPU の 活用方法 東京工業大学学術国際情報センター丸山直也第 10 回 GPU コンピューティング講習会 2011 年 9 月 28 日

TSUBAME2.0 における GPU の 活用方法 東京工業大学学術国際情報センター丸山直也第 10 回 GPU コンピューティング講習会 2011 年 9 月 28 日 TSUBAME2.0 における GPU の 活用方法 東京工業大学学術国際情報センター丸山直也第 10 回 GPU コンピューティング講習会 2011 年 9 月 28 日 目次 1. TSUBAMEのGPU 環境 2. プログラム作成 3. プログラム実行 4. 性能解析 デバッグ サンプルコードは /work0/gsic/seminars/gpu- 2011-09- 28 からコピー可能です 1.

More information

untitled

untitled 13 Verilog HDL 16 CPU CPU IP 16 1023 2 reg[ msb: lsb] [ ]; reg [15:0] MEM [0:1023]; //16 1024 16 1 16 2 FF 1 address 8 64 `resetall `timescale 1ns/10ps module mem8(address, readdata,writedata, write, read);

More information

GPU Computing on Business

GPU Computing on Business GPU Computing on Business 2010 Numerical Technologies Incorporated http://www.numtech.com/ 1 2 3 4 5 6 7 8 9 GPU Computing $$$ Revenue Total Cost low BEP Quantity 10 11 12 13 14 15 GPU Computing $$$ Revenue

More information

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」 ALTIMA Company, MACNICA, Inc Nios II HAL API Modular Scatter-Gather DMA Core Ver.17.1 2018 8 Rev.1 Nios II HAL API Modular Scatter-Gather DMA Core...3...3...4... 4... 5 3-2-1. msgdma... 6 3-2-2. On-Chip

More information

熊本大学学術リポジトリ Kumamoto University Repositor Title GPGPU による高速演算について Author(s) 榎本, 昌一 Citation Issue date Type URL Presentation

熊本大学学術リポジトリ Kumamoto University Repositor Title GPGPU による高速演算について Author(s) 榎本, 昌一 Citation Issue date Type URL Presentation 熊本大学学術リポジトリ Kumamoto University Repositor Title GPGPU による高速演算について Author(s) 榎本, 昌一 Citation Issue date 2011-03-17 Type URL Presentation http://hdl.handle.net/2298/23539 Right GPGPU による高速演算について 榎本昌一 東京大学大学院工学系研究科システム創成学専攻

More information

main.dvi

main.dvi PC 1 1 [1][2] [3][4] ( ) GPU(Graphics Processing Unit) GPU PC GPU PC ( 2 GPU ) GPU Harris Corner Detector[5] CPU ( ) ( ) CPU GPU 2 3 GPU 4 5 6 7 1 toyohiro@isc.kyutech.ac.jp 45 2 ( ) CPU ( ) ( ) () 2.1

More information

GPGPUクラスタの性能評価

GPGPUクラスタの性能評価 2008 年度理研 HPC シンポジウム第 3 世代 PC クラスタ GPGPU クラスタの性能評価 2009 年 3 月 12 日 富士通研究所成瀬彰 発表の概要 背景 GPGPU による高速化 CUDA の概要 GPU のメモリアクセス特性調査 姫野 BMT の高速化 GPGPU クラスタによる高速化 GPU Host 間のデータ転送 GPU-to-GPU の通信性能 GPGPU クラスタ上での姫野

More information

KBLAS[7] *1., CUBLAS.,,, Byte/flop., [13] 1 2. (AT). GPU AT,, GPU SYMV., SYMV CUDABLAS., (double, float) (cu- FloatComplex, cudoublecomplex).,, DD(dou

KBLAS[7] *1., CUBLAS.,,, Byte/flop., [13] 1 2. (AT). GPU AT,, GPU SYMV., SYMV CUDABLAS., (double, float) (cu- FloatComplex, cudoublecomplex).,, DD(dou Vol.214-HPC-146 No.14 214/1/3 CUDA-xSYMV 1,3,a) 1 2,3 2,3 (SYMV)., (GEMV) 2.,, mutex., CUBLAS., 1 2,. (AT). 2, SYMV GPU., SSYMV( SYMV), GeForce GTXTitan Black 211GFLOPS( 62.8%)., ( ) (, ) DD(double-double),

More information

今回の内容 CUDA 付属のライブラリ cublas 行列 ベクトル積, 行列 行列積 cusperse 行列格納形式 cufft 余弦波の FFT curand モンテカルロ法による円周率計算 Thrust 913

今回の内容 CUDA 付属のライブラリ cublas 行列 ベクトル積, 行列 行列積 cusperse 行列格納形式 cufft 余弦波の FFT curand モンテカルロ法による円周率計算 Thrust 913 GPU 最適化ライブラリ 長岡技術科学大学電気電子情報工学専攻出川智啓 今回の内容 CUDA 付属のライブラリ cublas 行列 ベクトル積, 行列 行列積 cusperse 行列格納形式 cufft 余弦波の FFT curand モンテカルロ法による円周率計算 Thrust 913 ライブラリ 特定の処理を行う複数のプログラムを再利用可能な形でまとめた集合体 動画像処理やファイル圧縮, 数値計算のライブラリが有名

More information

3. :, c, ν. 4. Burgers : t + c x = ν 2 u x 2, (3), ν. 5. : t + u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,., ν. t +

3. :, c, ν. 4. Burgers : t + c x = ν 2 u x 2, (3), ν. 5. : t + u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,., ν. t + B: 2016 12 2, 9, 16, 2017 1 6 1,.,,,,.,.,,,., 1,. 1. :, ν. 2. : t = ν 2 u x 2, (1), c. t + c x = 0, (2). e-mail: iwayama@kobe-u.ac.jp,. 1 3. :, c, ν. 4. Burgers : t + c x = ν 2 u x 2, (3), ν. 5. : t +

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

untitled

untitled H8/300,H8S,H8SX [H8S,H8/300 Tool Chain Ver6.2.0.0] #define Inline static inline //************************************************** Inline char sil_and_mem(char *mem,char and) return (*((volatile

More information

GPGPU

GPGPU GPGPU 2013 1008 2015 1 23 Abstract In recent years, with the advance of microscope technology, the alive cells have been able to observe. On the other hand, from the standpoint of image processing, the

More information

num2.dvi

num2.dvi kanenko@mbk.nifty.com http://kanenko.a.la9.jp/ 16 32...... h 0 h = ε () 0 ( ) 0 1 IEEE754 (ieee754.c Kerosoft Ltd.!) 1 2 : OS! : WindowsXP ( ) : X Window xcalc.. (,.) C double 10,??? 3 :, ( ) : BASIC,

More information

untitled

untitled EPX-64S Rev 1.2 1.. 3 1.1.......... 3 1.2....... 3 1.3....... 4 1.4... 4 1.5... 4 2........ 5 2.1.... 5 EPX64S_GetNumberOfDevices........ 5 EPX64S_GetSerialNumber........ 6 EPX64S_Open....... 7 EPX64S_OpenBySerialNumber

More information

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf(hello World!!\n); return 0; 戻り値 1: main() 2.2 C main C 2007 5 29 C 1 11 2 2.1 main() 1 FORTRAN C main() main main() main() 1 return 1 1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return

More information

2 09:00-09:30 受付 09:30-12:00 GPU 入門,CUDA 入門 13:00-14:30 OpenACC 入門 + HA-PACS ログイン 14:45-16:15 OpenACC 最適化入門と演習 16:30-18:00 CUDA 最適化入門と演習

2 09:00-09:30 受付 09:30-12:00 GPU 入門,CUDA 入門 13:00-14:30 OpenACC 入門 + HA-PACS ログイン 14:45-16:15 OpenACC 最適化入門と演習 16:30-18:00 CUDA 最適化入門と演習 担当 大島聡史 ( 助教 ) ohshima@cc.u-tokyo.ac.jp 星野哲也 ( 助教 ) hoshino@cc.u-tokyo.ac.jp 質問やサンプルプログラムの提供についてはメールでお問い合わせください 1 2016 年 6 月 8 日 ( 水 ) 東京大学情報基盤センター 2 09:00-09:30 受付 09:30-12:00 GPU 入門,CUDA 入門 13:00-14:30

More information

2

2 16 1050026 1050042 1 2 1 1.1 3 1.2 3 1.3 3 2 2.1 4 2.2 4 2.2.1 5 2.2.2 5 2.3 7 2.3.1 1Basic 7 2.3.2 2 8 2.3.3 3 9 2.3.4 4window size 10 2.3.5 5 11 3 3.1 12 3.2 CCF 1 13 3.3 14 3.4 2 15 3.5 3 17 20 20 20

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

joho07-1.ppt

joho07-1.ppt 0xbffffc5c 0xbffffc60 xxxxxxxx xxxxxxxx 00001010 00000000 00000000 00000000 01100011 00000000 00000000 00000000 xxxxxxxx x y 2 func1 func2 double func1(double y) { y = y + 5.0; return y; } double func2(double*

More information

プラズマ核融合学会誌5月号【81-5】/内外情報_ソフト【注:欧フォント特殊!】

プラズマ核融合学会誌5月号【81-5】/内外情報_ソフト【注:欧フォント特殊!】 PROGRAM PLOTDATA USE NUM_KINDS, ONLY : wp=>dp, i4b USE MYLIB, ONLY : GET_SIZE, GET_DATA INTEGER(i4b) :: ntime, nx REAL(wp), ALLOCATABLE :: time(:), x(:), Temp(:,:) Fortran Temp, temp, TEMP temporal REAL(wp)

More information

GPGPUイントロダクション

GPGPUイントロダクション 大島聡史 ( 並列計算分科会主査 東京大学情報基盤センター助教 ) GPGPU イントロダクション 1 目的 昨今注目を集めている GPGPU(GPU コンピューティング ) について紹介する GPGPU とは何か? 成り立ち 特徴 用途 ( ソフトウェアや研究例の紹介 ) 使い方 ( ライブラリ 言語 ) CUDA GPGPU における課題 2 GPGPU とは何か? GPGPU General-Purpose

More information

iphone GPGPU GPU OpenCL Mac OS X Snow LeopardOpenCL iphone OpenCL OpenCL NVIDIA GPU CUDA GPU GPU GPU 15 GPU GPU CPU GPU iii OpenMP MPI CPU OpenCL CUDA OpenCL CPU OpenCL GPU NVIDIA Fermi GPU Fermi GPU GPU

More information

23 Fig. 2: hwmodulev2 3. Reconfigurable HPC 3.1 hw/sw hw/sw hw/sw FPGA PC FPGA PC FPGA HPC FPGA FPGA hw/sw hw/sw hw- Module FPGA hwmodule hw/sw FPGA h

23 Fig. 2: hwmodulev2 3. Reconfigurable HPC 3.1 hw/sw hw/sw hw/sw FPGA PC FPGA PC FPGA HPC FPGA FPGA hw/sw hw/sw hw- Module FPGA hwmodule hw/sw FPGA h 23 FPGA CUDA Performance Comparison of FPGA Array with CUDA on Poisson Equation (lijiang@sekine-lab.ei.tuat.ac.jp), (kazuki@sekine-lab.ei.tuat.ac.jp), (takahashi@sekine-lab.ei.tuat.ac.jp), (tamukoh@cc.tuat.ac.jp),

More information

CuPy とは何か?

CuPy とは何か? GTC Japan 2018 CuPy NumPy 互換 GPU ライブラリによる Python での高速計算 Preferred Networks 取締役最高技術責任者奥田遼介 okuta@preferred.jp CuPy とは何か? CuPy とは GPU を使って NumPy 互換の機能を提供するライブラリ import numpy as np X_cpu = np.zeros((10,))

More information

2 2.1 Mac OS CPU Mac OS tar zxf zpares_0.9.6.tar.gz cd zpares_0.9.6 Mac Makefile Mekefile.inc cp Makefile.inc/make.inc.gfortran.seq.macosx make

2 2.1 Mac OS CPU Mac OS tar zxf zpares_0.9.6.tar.gz cd zpares_0.9.6 Mac Makefile Mekefile.inc cp Makefile.inc/make.inc.gfortran.seq.macosx make Sakurai-Sugiura z-pares 26 9 5 1 1 2 2 2.1 Mac OS CPU......................................... 2 2.2 Linux MPI............................................ 2 3 3 4 6 4.1 MUMPS....................................

More information

FFTSS Library Version 3.0 User's Guide

FFTSS Library Version 3.0 User's Guide : 19 10 31 FFTSS 3.0 Copyright (C) 2002-2007 The Scalable Software Infrastructure Project, (CREST),,. http://www.ssisc.org/ Contents 1 4 2 (DFT) 4 3 4 3.1 UNIX............................................

More information

名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL アライアンスパートナー コアテクノロジーパートナー NVIDIA JAPAN ソリュ

名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL   アライアンスパートナー コアテクノロジーパートナー NVIDIA JAPAN ソリュ GPUDirect の現状整理 multi-gpu に取組むために G-DEP チーフエンジニア河井博紀 (kawai@gdep.jp) 名称 : 日本 GPU コンピューティングパートナーシップ (G-DEP) 所在 : 東京都文京区本郷 7 丁目 3 番 1 号東京大学アントレプレナープラザ, 他工場 URL http://www.gdep.jp アライアンスパートナー コアテクノロジーパートナー

More information

4 倍精度基本線形代数ルーチン群 QPBLAS の紹介 [index] 1. Introduction 2. Double-double algorithm 3. QPBLAS 4. QPBLAS-GPU 5. Summary 佐々成正 1, 山田進 1, 町田昌彦 1, 今村俊幸 2, 奥田洋司

4 倍精度基本線形代数ルーチン群 QPBLAS の紹介 [index] 1. Introduction 2. Double-double algorithm 3. QPBLAS 4. QPBLAS-GPU 5. Summary 佐々成正 1, 山田進 1, 町田昌彦 1, 今村俊幸 2, 奥田洋司 4 倍精度基本線形代数ルーチン群 QPBLAS の紹介 [index] 1. Introduction 2. Double-double algorithm 3. QPBLAS 4. QPBLAS-GPU 5. Summary 佐々成正 1, 山田進 1, 町田昌彦 1, 今村俊幸 2, 奥田洋司 3 1 1 日本原子力研究開発機構システム計算科学センター 2 理科学研究所計算科学研究機構 3 東京大学新領域創成科学研究科

More information

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do (Version: 2017/4/18) Intel CPU (kashi@waseda.jp) 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU double 8087 FPU (floating point number processing unit)

More information