Difference between revisions of "Raytrace Scheduler"

From CSE231 Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Where to Start=
+
This Exercise Has Been Updated
==Demo==
+
<!--
 +
=Motivation=
 +
Gain some exposure to different task scheduling styles.
 +
 
 +
=Background=
 +
[https://en.wikipedia.org/wiki/Ray_tracing_(graphics) Ray Tracing]
 +
 
 +
<youtube>iLHNF7SgVN4</youtube>
 +
 
 +
=Code To Investigate=
 +
Static Scheduler-like ray tracer.
 +
 
 
{{CodeToInvestigate|SplitFourWayRayTracer|rayTrace|raytrace.demo}}
 
{{CodeToInvestigate|SplitFourWayRayTracer|rayTrace|raytrace.demo}}
  
Line 10: Line 21:
 
===DivideAndConquerRayTracer===
 
===DivideAndConquerRayTracer===
 
[[File:DivideAndConquerRayTracer.png|thumb]]
 
[[File:DivideAndConquerRayTracer.png|thumb]]
Recursively divide the given region into 4 tasks for each of the four quadrants until you get below the threshold.
+
Recursively divide the given region into 4 tasks for each of the four quadrants until you get below the threshold (see the IntPredicate areaThreshold instance variable).
When you get below the threshold, call the <code>renderSection</code> method to render the section.
+
When areaThreshold predicate test method returns false, call the <code>rayTraceBaseCase(context, xMin, yMix, xMax, yMax)</code> method to render the section.
  
 
{{CodeToImplement|DivideAndConquerRayTracer|rayTraceKernel|raytrace.fun}}
 
{{CodeToImplement|DivideAndConquerRayTracer|rayTraceKernel|raytrace.fun}}
  
{{Parallel|private void rayTraceKernel(RayTraceContext context, int xMin, int yMin, int xMax, int yMax, int areaThreshold)}}
+
{{Parallel|private void rayTraceKernel(RayTraceContext context, int xMin, int yMin, int xMax, int yMax)}}
  
 
===WorkStealingRayTracer===
 
===WorkStealingRayTracer===
Line 27: Line 38:
 
{{CodeToImplement|WorkStealingRayTracer|renderMyTasksUntilEmptyThenStealWorkFromOthers|raytrace.fun}}
 
{{CodeToImplement|WorkStealingRayTracer|renderMyTasksUntilEmptyThenStealWorkFromOthers|raytrace.fun}}
  
{{Sequential|private void renderMyTasksUntilEmptyThenStealWorkFromOthers(RayTraceTaskContext taskContext, List<ConcurrentLinkedDeque<Section>> quadrants, int id)}}
+
{{Sequential|private void renderMyTasksUntilEmptyThenStealWorkFromOthers(RayTraceTaskContext taskContext, Deque<Section> myTaskDeque, List<Deque<Section>> otherTaskDeques, int id)}}
 +
-->

Latest revision as of 15:50, 26 April 2022

This Exercise Has Been Updated