|FROM ||Ruben Safir
|SUBJECT ||Subject: [Learn] not adequately speced of explained
|From learn-bounces-at-nylxs.com Tue Nov 1 12:30:27 2016
Received: from www.mrbrklyn.com (www.mrbrklyn.com [18.104.22.168])
by mrbrklyn.com (Postfix) with ESMTP id 6CD8A161312;
Tue, 1 Nov 2016 12:30:27 -0400 (EDT)
Received: from [10.0.0.62] (flatbush.mrbrklyn.com [10.0.0.62])
by mrbrklyn.com (Postfix) with ESMTP id 556B9160E77;
Tue, 1 Nov 2016 12:30:23 -0400 (EDT)
To: learn-at-nylxs.com, Samir Iabbassen
From: Ruben Safir
Date: Tue, 1 Nov 2016 12:30:23 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Subject: [Learn] not adequately speced of explained
Content-Type: text/plain; charset="us-ascii"
Why am I wasting my time with this video on CUDA
Look at this stupid homework. There is not enough specification here to
attempt the home work. Instead your expected to beg the website for
We do NOT know the construction of the graphics. I don't even know what
a uchar4 is but that is not the least of the problem. I don't know is a
uchar4 is a mapping of data. I have NO CLUE what the two extra params are.
I didn't even know that i could add two additional params to the GLOBAL
I'm sick of WASTING TIME with sloppy crap like this. I can waste hours
of time trying to unravel the mystery of this.
I don't know what 2D is. I don't know what I am mapping. I don't have
a specification of any data structures whatsoever.
I HAVE NO DAMN SPECIFICATION HERE.
Why are we not using the MIT resources that are well thought out and
dumbed down to being unusable.
Why do I have to wander all the time in the dark.
// Homework 1
// Color to Greyscale Conversion
//A common way to represent color images is known as RGBA - the color
//is specified by how much Red, Green, and Blue is in it.
//The 'A' stands for Alpha and is used for transparency; it will be
//ignored in this homework.
//Each channel Red, Blue, Green, and Alpha is represented by one byte.
//Since we are using one byte for each color there are 256 different
//possible values for each color. This means we use 4 bytes per pixel.
//Greyscale images are represented by a single intensity value per pixel
//which is one byte in size.
//To convert an image from color to grayscale one simple method is to
//set the intensity to the average of the RGB channels. But we will
//use a more sophisticated method that takes into account how the eye
//perceives color and weights the channels unequally.
//The eye responds most strongly to green followed by red and then blue.
//The NTSC (National Television System Committee) recommends the following
//formula for color to greyscale conversion:
//I = .299f * R + .587f * G + .114f * B
//Notice the trailing f's on the numbers which indicate that they are
//single precision floating point constants and not double precision
//You should fill in the kernel as well as set the block and grid sizes
//so that the entire image is processed.
void rgba_to_greyscale(const uchar4* const rgbaImage,
unsigned char* const greyImage,
int numRows, int numCols)
//Fill in the kernel to convert from color to greyscale
//the mapping from components of a uchar4 to RGBA is:
// .x -> R ; .y -> G ; .z -> B ; .w -> A
//The output (greyImage) at each pixel should be the result of
//applying the formula: output = .299f * R + .587f * G + .114f * B;
//Note: We will be ignoring the alpha channel for this conversion
//First create a mapping from the 2D block and grid locations
//to an absolute 2D location in the image, then use that to
//calculate a 1D offset
int R = threadIdx.x;
int G = threadIdx.y;
int B = threadIdx.z;
float fR = float(R) * 0.299f;
float fG = float(G) * 0.587f;
float fB = float(B) * 0.114f;
float ave = (fR + fG + fB) / 3f ;
void your_rgba_to_greyscale(const uchar4 * const h_rgbaImage, uchar4 *
unsigned char* const d_greyImage, size_t
numRows, size_t numCols)
//You must fill in the correct sizes for the blockSize and gridSize
//currently only one block with one thread is being launched
const dim3 blockSize(1, 1, 1); //TODO
const dim3 gridSize( 1, 1, 1); //TODO
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013
Learn mailing list