FIGURE 11.1 Mapping between OpenCL and CUDA data parallelism model concepts. KIRK CH:11...

Post on 13-Jan-2016

221 views 0 download

Tags:

Transcript of FIGURE 11.1 Mapping between OpenCL and CUDA data parallelism model concepts. KIRK CH:11...

FIGURE 11.1Mapping between OpenCL and CUDA data parallelism model concepts.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.2Overview of the OpenCL parallel execution model.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.3Mapping of OpenCL dimensions and indices to CUDA dimensions and indices.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.4Conceptual OpenCL device architecture; the host is not shown.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.5Mapping of OpenCL memory types to CUDA memory types.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.6A simple OpenCL kernel example.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.7OpenCL context required to manage devices.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.8Creating an OpenCL context and command queue.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.9DCS Kernel Version 3 NDRange configuration.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.10Mapping DCS NDRange to OpenCL device.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.11Data access indexing in OpenCL and CUDA.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.12Inner loop of the OpenCL DCS kernel.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.13Building an OpenCL kernel.

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”

FIGURE 11.14OpenCL host code for kernel launch and .

KIRK

CH:11

“Programming Massively Parallel Processors: A Hands-on Approach. DOI: 10.1016/B978-0-12-381472-2.00009-X © 2010 David B. Kirk/NVIDIA Corporation and Wen-mei Hwu. Published by Elsevier Inc. All rights of reproduction in any form reserved.”