SlideShare una empresa de Scribd logo
1 de 25
VOLUME RENDERING OF
UNSTRUCTURED TETRAHEDRAL GRIDS
Flow
• Introduction
• Problem Formulation
• Tetrahedral Interpolation
• Implementation
• Results
• Demo
• Endnotes
04-06-2014
Nitesh Bhatia | CPDM
2
Introduction: Volume Rendering
• Volume rendering is a technique that can
be used to visualize sampled 3D scalar
data as a continuous medium or extract
features.
Most algorithms for direct volume rendering
have assumed structured data in form of
rectilinear grid.
• In this project we worked on a method for
rendering unstructured volume; volume
represented by group of tetrahedrals.
04-06-2014
Nitesh Bhatia | CPDM
3
Problem Formulation
• The idea is to convert unstructured input tetrahedral grid
(UG) to output structured regular grid (SG) and render it
using existing ray casting system.
• The data represented in UG must be interpolated to
produce SG.
• The UG consists of tetrahedrals bounded by four vertices
numbered 1,2,3,4, the coordinates of ith vertex being (xi,
yi, zi) and associated data value is denoted fi.
• The data values are assumed to be the values of an
unknown locally smooth trivariate function
interpolate discussed in next heading.
04-06-2014
Nitesh Bhatia | CPDM
4
1/3
Problem Formulation
• Let P = (x,y,z) be the point at which the value of interpolation function is
to be estimated.
Two different interpolation schemes are followed here:
• Scheme 1: Map SG to UG
• For a given point P of SG and find the tetrahedral associated with P
in UG
• Estimate the function values for given cell based on interpolate.
04-06-2014
Nitesh Bhatia | CPDM
5
empty SG UG SG
2/3
Problem Formulation
• Scheme 2: Map UG to SG
• Take a tetrahedral from UG and find points Ps lying on SG
• Estimate the function value at Ps based on interpolate.
04-06-2014
Nitesh Bhatia | CPDM
6
UG empty SG SG
3/3
Tetrahedral Interpolation: interpolate
• Given a tetrahedron T with vertices v1, v2, v3, v4 and
function value associated with these vertices be f1, f2, f3
and f4, the problem is to find interpolated function value f
for any given point P.
04-06-2014
Nitesh Bhatia | CPDM
7
.P(f)
v1(f1)
v2(f2)v4(f4)
v3(f3)
1/4
Tetrahedral Interpolation: interpolate
Geometric Solution
• Take ratio of perpendicular distance of P
to a face with perpendicular distance of
opposite vertex to that face.
• Find these ratios with all four faces and
name them l1, l2, l3 and l4.
• If the point P is lying inside tetrahedral
these ratios will come between 0 and 1.
• Sum of these ratios will always be 1.
• These l1,l2, l3 and l4 are known as
barycentric coordinates of point P with
respect to tetrahedral T.
• f = l1*f1 + l2*f2 + l3*f3 + l4*f4
04-06-2014 8
2/4
Nitesh Bhatia | CPDM
Tetrahedral Interpolation: interpolate
• Mathemetical Interpretation
04-06-2014
Nitesh Bhatia | CPDM
9
3/4
Tetrahedral Interpolation: interpolate
04-06-2014
Nitesh Bhatia | CPDM
10
4/4
Implementation
In implementation we are following 3 step approach
1. Load the vertices and tetrahedron information from
given .ts file into CPU memory
2. Based on two schemes presented, perform
computations using OpenCL (or OpenMP) to form a
regular grid
3. Display the grid by Ray Casting in OpenCL using CL-GL
Interoperability.
04-06-2014
Nitesh Bhatia | CPDM
11
Implementation: Description
Step1:
• The data set given .ts file is form of list of vertices with 3D
coordinates and associated function value and then a list of
tetrahedrons with asociated 4 vertices.
• We are first loading this information into memory.
• While loading the vertices we are computing minimum and
maximum values for (x,y,z) coordinates and storing it as minX,
minY, minZ, maxX, maxY, maxZ.
• We are then finding the difference between these minimum and
maximum values and storing it as diffX, diffY, diffZ.
• We are then computing diff equal to maximum of diffX, diffY
and diffZ.
• We are then finding dimensions of our bounding box with side
equal to diff.
04-06-2014
Nitesh Bhatia | CPDM
12
Step 2:
• Given
• We are computing A-1 for each tetrahedron
• We define a constant STEP_SIZE = 128 (or any other
value) which gives dimension of our volume as
128*128*128.
• We are setting the resolution (step size) of our volume as
res = diff / STEP_SIZE
04-06-2014
Nitesh Bhatia | CPDM
13
Scheme 1:
04-06-2014
Nitesh Bhatia | CPDM
14
1. Finding point lying
on SG
2. searching for
associated T in UG
and finding f value
using interpolation
• This scheme is implemented in both OpenCL and
OpenMP
• In OpenMP implementation we are adding following two
lines as compiler directive in starting of loop:
• #paragma omp set_num_threads(8)
• #paragma omp parallel for shared(i,j,k)
• In OpenCL implementation we are setting our dimensions
as 1D with
• size_t global_size = {STEP_SIZE * STEP_SIZE * STEP_SIZE}
• Here we are Parallelizing in terms of volume element
04-06-2014
Nitesh Bhatia | CPDM
15
Scheme2:
04-06-2014
Nitesh Bhatia | CPDM
16
1. Finding limits of
points lying inside
tetrahedral
2. For given limits finding f
values of points associated
with SG
• Scheme 2 is implemented in OpenCL. We are setting our
dimensions as 1D with
size_t global_size = tet_qty
• Here we are Parallelizing in terms of tetrahedral quantity
Step 3:
• We are then giving this 1D grid of function values to
existing ray tracer (provided by nVidia in their SDK) as
input.
04-06-2014
Nitesh Bhatia | CPDM
17
Results
• Hardware / Software for tests
04-06-2014
Nitesh Bhatia | CPDM
18
GPU
Model: nVidia Quadro FX 580
Cores: 32
Core Clock: 450 MHz
Memory: 512MB
Memory Bandwidth: 25.6 GiB/s
CPU
Model: Intel Core i7 860
Cores / Threads: 4/8
Clock Speed: 2.8GHz (3.0GHz when running on full load)
Memory: 8 GB
Memory Bandwidth: 21GB/s
OS / SDKs
Microsoft Windows 7 Professional 64Bit
Visual Studio 2010 32Bit
Microsoft OpenMP
nVidia CUDA SDK 3.2
nVidia OpenCL 1.1
Intel OpenCL 1.1 alpha
Input UG
Torus1.ts
Torusf1.ts
Torus8.ts
Engine.ts
04-06-2014
Nitesh Bhatia | CPDM
19
Scheme 1 Scheme 2
STEP_SIZE = 512
Time: 8.4 sec
STEP_SIZE = 512
Time: 2.5 sec
04-06-2014
Nitesh Bhatia | CPDM
20
Scheme 1 Scheme 2
STEP_SIZE = 512
Time: 2.5 sec
STEP_SIZE = 512
Time: 3.3 sec
04-06-2014
Nitesh Bhatia | CPDM
21
04-06-2014
Nitesh Bhatia | CPDM
22
• Demo Video URL:
https://www.youtube.com/watch?v=CaBuZ7
se7-o
04-06-2014
Nitesh Bhatia | CPDM
23
Impressions
• Learning OpenCL was a challenging task but we it was
interesting.
• Debugging OpenCL is difficult task as stream output
(“printf” function) cannot be called in openCL kernel. In
Intel’s compiler is based on OpenCL 1.1 in which “printf” is
supported.
• Double precision computations are not supported on my
card.
• Graphic Driver Crash Problem
04-06-2014
Nitesh Bhatia | CPDM
24
“We now know a thousand ways not to
build a light bulb”
04-06-2014
Nitesh Bhatia | CPDM
25
THANKS !

Más contenido relacionado

Similar a Volume Rendering of Unstructured Tetrahedral Grids using Intel / nVidia OpenCL

Writing distributed N-body code using distributed FFT - 1
Writing distributed N-body code using distributed FFT - 1Writing distributed N-body code using distributed FFT - 1
Writing distributed N-body code using distributed FFT - 1
kr0y
 
Optimizing Set-Similarity Join and Search with Different Prefix Schemes
Optimizing Set-Similarity Join and Search with Different Prefix SchemesOptimizing Set-Similarity Join and Search with Different Prefix Schemes
Optimizing Set-Similarity Join and Search with Different Prefix Schemes
HPCC Systems
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
NAVER Engineering
 

Similar a Volume Rendering of Unstructured Tetrahedral Grids using Intel / nVidia OpenCL (20)

Writing distributed N-body code using distributed FFT - 1
Writing distributed N-body code using distributed FFT - 1Writing distributed N-body code using distributed FFT - 1
Writing distributed N-body code using distributed FFT - 1
 
Optimizing Set-Similarity Join and Search with Different Prefix Schemes
Optimizing Set-Similarity Join and Search with Different Prefix SchemesOptimizing Set-Similarity Join and Search with Different Prefix Schemes
Optimizing Set-Similarity Join and Search with Different Prefix Schemes
 
Optimizing Data Partitioning at Broadcasting the Data
Optimizing Data Partitioning at Broadcasting the DataOptimizing Data Partitioning at Broadcasting the Data
Optimizing Data Partitioning at Broadcasting the Data
 
aspice
aspiceaspice
aspice
 
Id3313941396
Id3313941396Id3313941396
Id3313941396
 
Id3313941396
Id3313941396Id3313941396
Id3313941396
 
Parallel Hardware Implementation of Convolution using Vedic Mathematics
Parallel Hardware Implementation of Convolution using Vedic MathematicsParallel Hardware Implementation of Convolution using Vedic Mathematics
Parallel Hardware Implementation of Convolution using Vedic Mathematics
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
 
AI optimizing HPC simulations (presentation from 6th EULAG Workshop)
AI optimizing HPC simulations (presentation from  6th EULAG Workshop)AI optimizing HPC simulations (presentation from  6th EULAG Workshop)
AI optimizing HPC simulations (presentation from 6th EULAG Workshop)
 
Ijetr042170
Ijetr042170Ijetr042170
Ijetr042170
 
Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithms
 
Unsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptxUnsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptx
 
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
 
distance_matrix_ch
distance_matrix_chdistance_matrix_ch
distance_matrix_ch
 
Nbvtalkataitamimageprocessingconf
NbvtalkataitamimageprocessingconfNbvtalkataitamimageprocessingconf
Nbvtalkataitamimageprocessingconf
 
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
 
Lecture set 5
Lecture set 5Lecture set 5
Lecture set 5
 
R04603104107
R04603104107R04603104107
R04603104107
 
Approximation Data Structures for Streaming Applications
Approximation Data Structures for Streaming ApplicationsApproximation Data Structures for Streaming Applications
Approximation Data Structures for Streaming Applications
 
Support Vector Machine (SVM) Artificial Intelligence
Support Vector Machine (SVM) Artificial IntelligenceSupport Vector Machine (SVM) Artificial Intelligence
Support Vector Machine (SVM) Artificial Intelligence
 

Más de Nitesh Bhatia

Design Flaws In Products
Design Flaws In ProductsDesign Flaws In Products
Design Flaws In Products
Nitesh Bhatia
 

Más de Nitesh Bhatia (13)

JTAG Interface (Intro)
JTAG Interface (Intro)JTAG Interface (Intro)
JTAG Interface (Intro)
 
Cost Estimation in Project Management - Case of Solar Assisted Water Pump
Cost Estimation in Project Management - Case of Solar Assisted Water PumpCost Estimation in Project Management - Case of Solar Assisted Water Pump
Cost Estimation in Project Management - Case of Solar Assisted Water Pump
 
Solution Neutral Problem Statement (SNPS) Generation (Example - Cooking India...
Solution Neutral Problem Statement (SNPS) Generation (Example - Cooking India...Solution Neutral Problem Statement (SNPS) Generation (Example - Cooking India...
Solution Neutral Problem Statement (SNPS) Generation (Example - Cooking India...
 
Mapping - Reality and Virtual Reality (Strictly No AR!!)
Mapping - Reality and Virtual Reality (Strictly No AR!!)Mapping - Reality and Virtual Reality (Strictly No AR!!)
Mapping - Reality and Virtual Reality (Strictly No AR!!)
 
Natural User Interface Demo based on - 3D Brick Game using Kinect
Natural User Interface Demo based on - 3D Brick Game using KinectNatural User Interface Demo based on - 3D Brick Game using Kinect
Natural User Interface Demo based on - 3D Brick Game using Kinect
 
iKeymote - Internet Keyboard cum Remote (Idea Design)
iKeymote - Internet Keyboard cum Remote (Idea Design)iKeymote - Internet Keyboard cum Remote (Idea Design)
iKeymote - Internet Keyboard cum Remote (Idea Design)
 
Visual space perception
Visual space perceptionVisual space perception
Visual space perception
 
PPT- Chaos Prediction using Visual Surveillance and Network Computing
PPT- Chaos Prediction using Visual Surveillance and Network ComputingPPT- Chaos Prediction using Visual Surveillance and Network Computing
PPT- Chaos Prediction using Visual Surveillance and Network Computing
 
Give up - Orkut App
Give up - Orkut AppGive up - Orkut App
Give up - Orkut App
 
Lecture 1 - Web Engineering - Apple iClub at DA-IICT
Lecture 1 - Web Engineering - Apple iClub at DA-IICTLecture 1 - Web Engineering - Apple iClub at DA-IICT
Lecture 1 - Web Engineering - Apple iClub at DA-IICT
 
Introduction to Lectures in Apple iClub at DA-IICT
Introduction to Lectures in Apple iClub  at DA-IICTIntroduction to Lectures in Apple iClub  at DA-IICT
Introduction to Lectures in Apple iClub at DA-IICT
 
Apple iClub at DA-IICT Opening PPT
Apple iClub at DA-IICT Opening PPTApple iClub at DA-IICT Opening PPT
Apple iClub at DA-IICT Opening PPT
 
Design Flaws In Products
Design Flaws In ProductsDesign Flaws In Products
Design Flaws In Products
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Volume Rendering of Unstructured Tetrahedral Grids using Intel / nVidia OpenCL

  • 2. Flow • Introduction • Problem Formulation • Tetrahedral Interpolation • Implementation • Results • Demo • Endnotes 04-06-2014 Nitesh Bhatia | CPDM 2
  • 3. Introduction: Volume Rendering • Volume rendering is a technique that can be used to visualize sampled 3D scalar data as a continuous medium or extract features. Most algorithms for direct volume rendering have assumed structured data in form of rectilinear grid. • In this project we worked on a method for rendering unstructured volume; volume represented by group of tetrahedrals. 04-06-2014 Nitesh Bhatia | CPDM 3
  • 4. Problem Formulation • The idea is to convert unstructured input tetrahedral grid (UG) to output structured regular grid (SG) and render it using existing ray casting system. • The data represented in UG must be interpolated to produce SG. • The UG consists of tetrahedrals bounded by four vertices numbered 1,2,3,4, the coordinates of ith vertex being (xi, yi, zi) and associated data value is denoted fi. • The data values are assumed to be the values of an unknown locally smooth trivariate function interpolate discussed in next heading. 04-06-2014 Nitesh Bhatia | CPDM 4 1/3
  • 5. Problem Formulation • Let P = (x,y,z) be the point at which the value of interpolation function is to be estimated. Two different interpolation schemes are followed here: • Scheme 1: Map SG to UG • For a given point P of SG and find the tetrahedral associated with P in UG • Estimate the function values for given cell based on interpolate. 04-06-2014 Nitesh Bhatia | CPDM 5 empty SG UG SG 2/3
  • 6. Problem Formulation • Scheme 2: Map UG to SG • Take a tetrahedral from UG and find points Ps lying on SG • Estimate the function value at Ps based on interpolate. 04-06-2014 Nitesh Bhatia | CPDM 6 UG empty SG SG 3/3
  • 7. Tetrahedral Interpolation: interpolate • Given a tetrahedron T with vertices v1, v2, v3, v4 and function value associated with these vertices be f1, f2, f3 and f4, the problem is to find interpolated function value f for any given point P. 04-06-2014 Nitesh Bhatia | CPDM 7 .P(f) v1(f1) v2(f2)v4(f4) v3(f3) 1/4
  • 8. Tetrahedral Interpolation: interpolate Geometric Solution • Take ratio of perpendicular distance of P to a face with perpendicular distance of opposite vertex to that face. • Find these ratios with all four faces and name them l1, l2, l3 and l4. • If the point P is lying inside tetrahedral these ratios will come between 0 and 1. • Sum of these ratios will always be 1. • These l1,l2, l3 and l4 are known as barycentric coordinates of point P with respect to tetrahedral T. • f = l1*f1 + l2*f2 + l3*f3 + l4*f4 04-06-2014 8 2/4 Nitesh Bhatia | CPDM
  • 9. Tetrahedral Interpolation: interpolate • Mathemetical Interpretation 04-06-2014 Nitesh Bhatia | CPDM 9 3/4
  • 11. Implementation In implementation we are following 3 step approach 1. Load the vertices and tetrahedron information from given .ts file into CPU memory 2. Based on two schemes presented, perform computations using OpenCL (or OpenMP) to form a regular grid 3. Display the grid by Ray Casting in OpenCL using CL-GL Interoperability. 04-06-2014 Nitesh Bhatia | CPDM 11
  • 12. Implementation: Description Step1: • The data set given .ts file is form of list of vertices with 3D coordinates and associated function value and then a list of tetrahedrons with asociated 4 vertices. • We are first loading this information into memory. • While loading the vertices we are computing minimum and maximum values for (x,y,z) coordinates and storing it as minX, minY, minZ, maxX, maxY, maxZ. • We are then finding the difference between these minimum and maximum values and storing it as diffX, diffY, diffZ. • We are then computing diff equal to maximum of diffX, diffY and diffZ. • We are then finding dimensions of our bounding box with side equal to diff. 04-06-2014 Nitesh Bhatia | CPDM 12
  • 13. Step 2: • Given • We are computing A-1 for each tetrahedron • We define a constant STEP_SIZE = 128 (or any other value) which gives dimension of our volume as 128*128*128. • We are setting the resolution (step size) of our volume as res = diff / STEP_SIZE 04-06-2014 Nitesh Bhatia | CPDM 13
  • 14. Scheme 1: 04-06-2014 Nitesh Bhatia | CPDM 14 1. Finding point lying on SG 2. searching for associated T in UG and finding f value using interpolation
  • 15. • This scheme is implemented in both OpenCL and OpenMP • In OpenMP implementation we are adding following two lines as compiler directive in starting of loop: • #paragma omp set_num_threads(8) • #paragma omp parallel for shared(i,j,k) • In OpenCL implementation we are setting our dimensions as 1D with • size_t global_size = {STEP_SIZE * STEP_SIZE * STEP_SIZE} • Here we are Parallelizing in terms of volume element 04-06-2014 Nitesh Bhatia | CPDM 15
  • 16. Scheme2: 04-06-2014 Nitesh Bhatia | CPDM 16 1. Finding limits of points lying inside tetrahedral 2. For given limits finding f values of points associated with SG
  • 17. • Scheme 2 is implemented in OpenCL. We are setting our dimensions as 1D with size_t global_size = tet_qty • Here we are Parallelizing in terms of tetrahedral quantity Step 3: • We are then giving this 1D grid of function values to existing ray tracer (provided by nVidia in their SDK) as input. 04-06-2014 Nitesh Bhatia | CPDM 17
  • 18. Results • Hardware / Software for tests 04-06-2014 Nitesh Bhatia | CPDM 18 GPU Model: nVidia Quadro FX 580 Cores: 32 Core Clock: 450 MHz Memory: 512MB Memory Bandwidth: 25.6 GiB/s CPU Model: Intel Core i7 860 Cores / Threads: 4/8 Clock Speed: 2.8GHz (3.0GHz when running on full load) Memory: 8 GB Memory Bandwidth: 21GB/s OS / SDKs Microsoft Windows 7 Professional 64Bit Visual Studio 2010 32Bit Microsoft OpenMP nVidia CUDA SDK 3.2 nVidia OpenCL 1.1 Intel OpenCL 1.1 alpha Input UG Torus1.ts Torusf1.ts Torus8.ts Engine.ts
  • 19. 04-06-2014 Nitesh Bhatia | CPDM 19 Scheme 1 Scheme 2 STEP_SIZE = 512 Time: 8.4 sec STEP_SIZE = 512 Time: 2.5 sec
  • 20. 04-06-2014 Nitesh Bhatia | CPDM 20 Scheme 1 Scheme 2 STEP_SIZE = 512 Time: 2.5 sec STEP_SIZE = 512 Time: 3.3 sec
  • 23. • Demo Video URL: https://www.youtube.com/watch?v=CaBuZ7 se7-o 04-06-2014 Nitesh Bhatia | CPDM 23
  • 24. Impressions • Learning OpenCL was a challenging task but we it was interesting. • Debugging OpenCL is difficult task as stream output (“printf” function) cannot be called in openCL kernel. In Intel’s compiler is based on OpenCL 1.1 in which “printf” is supported. • Double precision computations are not supported on my card. • Graphic Driver Crash Problem 04-06-2014 Nitesh Bhatia | CPDM 24
  • 25. “We now know a thousand ways not to build a light bulb” 04-06-2014 Nitesh Bhatia | CPDM 25 THANKS !