Vishwa07 / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

Figure out how to deprecate the functionality in thrust/system/cuda_error.h #452

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm going to add thrust/system/cuda/error.h to contain the cuda-specific 
functionality for reporting errors. the idea being that if a backend system 
needs such things it goes into an error.h header

i'm not sure how to deprecate the old names like thrust::system::cuda_error -- 
can't remember what we've done in the past. maybe a typedef inside of 
thrust::system with a deprecation warning?  can we do that?

right now thrust/system/cuda_error.h has a deprecation warning message and 
#includes the new header

Original issue reported on code.google.com by jaredhoberock on 27 Jan 2012 at 1:20

GoogleCodeExporter commented 9 years ago
Here are the old names

thrust::system::cuda_errc  // this is a namespace
thrust::system::cuda_errc_t
thrust::system::cuda_category
thrust::cuda_category  // this is a using alias
thrust::cuda_ercc      // this is a using alias

New names should be

thrust::system::cuda::errc
thrust::system::cuda::errc_t
thrust::system::cuda::error_category
thrust::cuda::error_category // this is a using alias
thrust::cuda::ercc           // this is a using alias

Make thrust::system::cuda_errc a using alias of thrust::system::cuda::errc
Make thrust::system::cuda_errc_t a typedef of thrust::system::cuda::errc_t
Make thrust::system::cuda_category a deprecated function that does nothing 
except call thrust::system::cuda::error_category
Leave thrust::cuda_category a using alias of thrust::system::cuda_category. 
deprecate it, if using aliases can be deprecated
Leave thrust::cuda_ercc a using alias of thrust::system::cuda_errc. deprecate 
it, if using namespaces can be deprecated

Original comment by jaredhoberock on 27 Jan 2012 at 8:14

GoogleCodeExporter commented 9 years ago
New name for the function

thrust::system::cuda_category

should be

thrust::system::cuda::category

rather than

thrust::system::cuda::error_category

because

thrust::system::error_category is a type, not a function

Original comment by jaredhoberock on 27 Jan 2012 at 9:53

GoogleCodeExporter commented 9 years ago
Still not sure whether to rename thrust::system::cuda_category to 
thrust::system::cuda::category

"category" seems not descriptive enough. "error_category" seems better, but the 
function declaration looks weird:

namespace cuda
{

thrust::error_category &error_category()

}

Also, there are a lot of names in std:: that are just "category".

Here are some names in std::

const error_category &future_category();

const error_category &generic_category();

const error_category &system_category();

Maybe we should just keep thrust::system::cuda_category (and the alias 
thrust::cuda_category)

Original comment by jaredhoberock on 27 Jan 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Decided to keep thrust::system::cuda_category & thrust::cuda_category as-is.  
We can deprecate and provide a new name later if we care to.

thrust::system::cuda_errc et al still get renamed. It's not likely many folks 
use this stuff anyway.

The only change most users will need to make is to use the new header to avoid 
the deprecation warning.

Original comment by jaredhoberock on 27 Jan 2012 at 11:54

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 9d272d18fc81.

Original comment by jaredhoberock on 28 Jan 2012 at 12:39