CUDA Native programming model

Assignment Help Programming Languages
Reference no: EM133090134

Question: Rank Sort 

This algorithm finds the rank of each number in an array and places it in order in a second array. This isn't a good sequential algorithm (0(N2)), but there is plenty of parallelism as the iterations of the inner loop can be done independently:

function ranksort(a)
a = length(a)
b = similar(a)
for i in 1:n
idx =0
einbounds for J in 1:n
a[i] > a[J] && (idx += 1)
end
b(idx+1] = a[i]
end
return b
end

Your task is to parallelize this algorithm for CPU execution in two ways:

1. With Julia's CUDA Native programming model, replacing the inner loop with a call to a CUDA kernel. The function must include a parameter chunkSize, which is the munber of iterations assigned to each thread.

2. With Julia's CuArrays programming model, replacing the inner loop with Julia's broadcast/dot notation. To do this you'll need to write the comparison moults to a temporary array and then sum this array using the CUDA/Julia sum() function.

Test your functions for correctness and benchmark them on Mach2. Please note that the second function will give poor performance. See if you can optimize it but don't be disappointed if it's still slower than the CPU version. Test your first function with a few chunk sizes varying from 1 to 128 and for two arrays of different sizes with at least 218 floats. Don't forget to test for correctness! Compare the performance of both functions (in Maps, based on n2 + n array operations) with the performance of the sequential ranksort().

To pass in the assignment: Submit a .zip file of your source code and a single pdf document containing listings of your code and output from your testing, and submit it via D2L. Name your document LastNanefirstName A3.pdf (LastNtune and FirstName are of course substituted with your last and first name).

Reference no: EM133090134

Questions Cloud

What is the cost per mile for this car : The sales tax is 6.5 percent and you intend to use the car for four years. You drive 10,000 miles per year. What is the cost per mile for this car
How much does it cost to operate this car : Assume you and your spouse were recently married and bought your first car, a used Toyota, for $10,000. How much does it cost to operate this car
Describe how each influence lives of others positively : Describe how each influence the lives of others positively and/or negatively. Provide leadership similarities and differences of the two leaders.
What is the minimum transfer price : Fixed cost per unit of the component is $25. What is the minimum transfer price if the division is operating at capacity
CUDA Native programming model : CUDA Native programming model, replacing the inner loop with a call to a CUDA kernel. The function must include a parameter chunkSize, which is the munber
What is the pension expense : The Sophia Company adopted a defined benefit pension plan on January 1, 2015, What is the pension expense for 2015
Member current behaviour : One of the members of your team continually arrives late for meetings and does not turn drafts of assignments in on time. Choose one of the available theories a
Consider the metrics of targeting : Consider the metrics of targeting, temporary, special, and irregular promotions.
Project scheduling : "Market pressures, competition among rivals become brutal in the contemporary time.

Reviews

len3090134

2/21/2022 9:46:30 PM

Julia language- Parallel computing. check attachment. as a result I should receive 2 running codes , with screenshots of the running codes out put(output includes the sorted array of 10 thousand elements and the time and memory consumed to run each code- this can be done by a small function in Julia called @btime). the array to be calculated should have 10000 elements. numbers in the array should be in the range 0-9999 (randomly). Follow the instructions in the assignment to know how to build the codes.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd