wow2006 / cudpp

Automatically exported from code.google.com/p/cudpp
Other
0 stars 0 forks source link

vectorSegmentedAddUniformToRight4 in vector_kernel needs indices argument clarified #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In vector_kernel, the function vectorSegmentedAddUniformToRight4 has an
argument "d_minIndices" but the documentation for that argument refers to
an "array of maximum indices". Please make the documentation and argument
name match the functionality.

Original issue reported on code.google.com by jow...@gmail.com on 17 Jun 2009 at 10:48

GoogleCodeExporter commented 9 years ago
Assigning to Shubho since this is his function.

Original comment by harr...@gmail.com on 17 Jun 2009 at 11:30

GoogleCodeExporter commented 9 years ago

Original comment by harr...@gmail.com on 23 Jun 2009 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by shu...@gmail.com on 25 Jun 2009 at 4:50

GoogleCodeExporter commented 9 years ago
John to verify.

Original comment by harr...@gmail.com on 25 Jun 2009 at 4:57

GoogleCodeExporter commented 9 years ago
Shubho, can you clarify the way this argument works? Is this greater-than or
greater-than-or-equal-to? If it's as described, I don't see how it would be 
possible
to specify a minimum index that is just to the right of 0, since 0 seems to be
special-cased according to the description.

Also, there's a reference to d_maxindex in the kernel description, but there's 
no
d_maxindex argument. It looks like the kernel description was copied from the
previous kernel.

Also, there's a FIXME comment in this kernel.

Original comment by jow...@gmail.com on 25 Jun 2009 at 1:12

GoogleCodeExporter commented 9 years ago
It is greater than. If it is 0 then it is added to the whole CTA. if it is 1 
you have a minimum index which is just to 
the right of 0 (the minimum index is 1-based)

changed d_maxIndex to d_minIndex

FIXME is unrelated to this issue - can open a new one to fix that

Original comment by shu...@gmail.com on 25 Jun 2009 at 5:10

GoogleCodeExporter commented 9 years ago
Can you clarify the 1-based thing in the comments? It seems to me that
greater-than-with-1-index is equivalent to the simpler
greater-than-or-equal-to-with-0-index, but I just want it described completely; 
I
didn't write the code. But "1-index" is not mentioned in the documentation at 
all and
it seems like it should be.

Original comment by jow...@gmail.com on 25 Jun 2009 at 5:19

GoogleCodeExporter commented 9 years ago
It is in line 293 - and also in segmented_scan_cta.cu where they are generated.

There is a reason why it is 1 - if the first element of a CTA has a flag - the 
index would be 0 - but 0 also means 
the absence of a flag. Hence a 1-based index to prevent overloading of what 0 
means.

Original comment by shu...@gmail.com on 25 Jun 2009 at 5:27

GoogleCodeExporter commented 9 years ago
That clarification - why it's one-based - is worth adding. It would make it much
easier for those who modify/use your code to understand it.

Original comment by jow...@gmail.com on 25 Jun 2009 at 5:52

GoogleCodeExporter commented 9 years ago
Added clarification

Original comment by shu...@gmail.com on 25 Jun 2009 at 9:49

GoogleCodeExporter commented 9 years ago
That's helpful, thanks.

Original comment by jow...@gmail.com on 25 Jun 2009 at 9:55