Posted in Programming

Download Accelerating MATLAB with GPU Computing: A Primer with by Jung W. Suh, Youngmin Kim PDF

By Jung W. Suh, Youngmin Kim

Past simulation and set of rules improvement, many builders more and more use MATLAB even for product deployment in computationally heavy fields. This usually calls for that MATLAB codes run quicker via leveraging the allotted parallelism of pix Processing devices (GPUs). whereas MATLAB effectively presents high-level features as a simulation instrument for swift prototyping, the underlying info and data wanted for using GPUs make MATLAB clients hesitate to step into it. Accelerating MATLAB with GPUs bargains a primer on bridging this gap.

Starting with the fundamentals, constructing MATLAB for CUDA (in home windows, Linux and Mac OS X) and profiling, it then courses clients via complex subject matters comparable to CUDA libraries. The authors percentage their event constructing algorithms utilizing MATLAB, C++ and GPUs for enormous datasets, enhancing MATLAB codes to higher make the most of the computational energy of GPUs, and integrating them into advertisement software program items. in the course of the e-book, they show many instance codes that may be used as templates of C-MEX and CUDA codes for readers' initiatives. obtain instance codes from the publisher's web site: http://booksite.elsevier.com/9780124080805/

• exhibits find out how to speed up MATLAB codes throughout the GPU for parallel processing, with minimum knowledge
• Explains the comparable history on undefined, structure and programming for ease of use
• presents easy labored examples of MATLAB and CUDA C codes in addition to templates that may be reused in real-world initiatives

Show description

Read Online or Download Accelerating MATLAB with GPU Computing: A Primer with Examples PDF

Best programming books

Processing: A Programming Handbook for Visual Designers and Artists

It's been greater than 20 years on account that computing device publishing reinvented layout, and it's transparent that there's a growing to be desire for designers and artists to benefit programming abilities to fill the widening hole among their principles and the aptitude in their bought software program. This booklet is an creation to the options of machine programming in the context of the visible arts.

Common Lisp: A Gentle Introduction to Symbolic Computation

A hugely available creation to LISP, this is often for green programmers and programmers new to LISP. A LISP "toolkit" in every one bankruptcy explains the way to use universal LISP programming and debugging instruments similar to DESCRIBE, check up on, hint and STEP.

Additional resources for Accelerating MATLAB with GPU Computing: A Primer with Examples

Example text

H in the working directory. Enter the following codes and save: 1 2 3 4 5 6 #ifndef __ADDVECTORS_H__ #define __ADDVECTORS_H__ extern void addVectors(float* A, float* B, float* C, int size); #endif // __ADDVECTORS_H__ In this header file, we declare our vector addition function prototype which we will use in our mex function. extern indicates that our function is implemented in some other file. Step 2. cu. cu represents the CUDA file. Create a new file in the MATLAB editor. x; 7 if (i . 5 size) 8 return; 9 10 C[i] 5 A[i] 1 B[i]; Configurations for MATLAB and CUDA 29 11 } 12 13 void addVectors(float* A, float* B, float* C, int size) 14 { 15 float *devPtrA 5 0, *devPtrB 5 0, *devPtrC 5 0; 16 17 cudaMalloc(&devPtrA, sizeof(float) * size); 18 cudaMalloc(&devPtrB, sizeof(float) * size); 19 cudaMalloc(&devPtrC, sizeof(float) * size); 20 21 cudaMemcpy(devPtrA, A, sizeof(float) * size, cudaMemcpyHostToDevice); 22 cudaMemcpy(devPtrB, B, sizeof(float) * size, cudaMemcpyHostToDevice); 23 24 addVectorsMask ,, , size, 1 ..

Step 2. cu. cu represents the CUDA file. Create a new file in the MATLAB editor. x; 7 if (i . 5 size) 8 return; 9 10 C[i] 5 A[i] 1 B[i]; Configurations for MATLAB and CUDA 29 11 } 12 13 void addVectors(float* A, float* B, float* C, int size) 14 { 15 float *devPtrA 5 0, *devPtrB 5 0, *devPtrC 5 0; 16 17 cudaMalloc(&devPtrA, sizeof(float) * size); 18 cudaMalloc(&devPtrB, sizeof(float) * size); 19 cudaMalloc(&devPtrC, sizeof(float) * size); 20 21 cudaMemcpy(devPtrA, A, sizeof(float) * size, cudaMemcpyHostToDevice); 22 cudaMemcpy(devPtrB, B, sizeof(float) * size, cudaMemcpyHostToDevice); 23 24 addVectorsMask ,, , size, 1 ..

12). Go to Nsight in the menu and select Start Performance Analysis. . 13). 14. In Application:, click on the folder browser button to select MATLAB executable. MATLAB executable can be found where your MATLAB is installed. You have to specifically select the one that is correct for your system architecture. 15. 12 Nsight installed in Microsoft Visual Studio. exe and click on Open to close the dialog. Now, scroll down a little bit to Activity Type. 16). After you select this option, the Launch button in Application Control is enabled.

Download PDF sample

Rated 4.89 of 5 – based on 3 votes