Difference between revisions of "Raytrace Scheduler"

From CSE231 Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
This Exercise Has Been Updated
 +
<!--
 
=Motivation=
 
=Motivation=
 
Gain some exposure to different task scheduling styles.
 
Gain some exposure to different task scheduling styles.
Line 8: Line 10:
  
 
=Code To Investigate=
 
=Code To Investigate=
 +
Static Scheduler-like ray tracer.
 +
 
{{CodeToInvestigate|SplitFourWayRayTracer|rayTrace|raytrace.demo}}
 
{{CodeToInvestigate|SplitFourWayRayTracer|rayTrace|raytrace.demo}}
  
Line 17: 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 areaThreshold predicate test method returns false, call the <code>rayTraceBaseCase(context, xMin, yMix, xMax, yMax)</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 35: Line 39:
  
 
{{Sequential|private void renderMyTasksUntilEmptyThenStealWorkFromOthers(RayTraceTaskContext taskContext, Deque<Section> myTaskDeque, List<Deque<Section>> otherTaskDeques, 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