Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to finalizers, device_reset and error handling. #19

Closed
wants to merge 5 commits into from

Conversation

ikirill
Copy link

@ikirill ikirill commented Feb 18, 2015

Related to #17.

Main changes:

  • Use CudaError and CudaDriverError instead of plain error(message-string)
  • When running finalizers, ignore all errors so that other finalizing code still executes (see device_reset can throw errors and not reset the device #17)
  • Force device initialization by allocating 0 bytes not 1 (efficiency!, also no need to call free)
  • Restrict launch arguments to bits types, because others are not handled at all, and likely need StrPack support do get correct structure layout (e.g., float4 must be aligned to 16 bytes, etc.). So it's best to forbid unsupported types completely for now.

What's your opinion on StrPack? There should be a "julian" way of passing arbitrary composite types to cuda. (Related: #14)

An exception thrown in a finalizer (produced either by the finalizer or
by a previous asynchronous call) would mean that cudaDeviceReset() would
not be called, causing trouble elsewhere.
Before, "error" would be used instead, which is less convenient for
distinguishing errors.
@ikirill
Copy link
Author

ikirill commented Feb 18, 2015

The last commit is broken, Julia doesn't let me import CUDArt into CUDArt_gen, so CudaError symbol is not defined.

@timholy
Copy link
Contributor

timholy commented Feb 18, 2015

Overall it looks pretty promising. If you can fix the breakage, let's merge. One option is to leave that one error message as-is; another is to explore scoping. Perhaps adding one or more dots, e.g., ..CUDArt.CudaError, might work.

@timholy
Copy link
Contributor

timholy commented Mar 24, 2015

Just wanting to check, have there been any changes here? GitHub doesn't notify me when you push additional commits.

@ericjang
Copy link

Has this been resolved? Also, can you provide a test case of using StrPack for Composite types? I'm not sure what the "julian" API for that should look like. Cheers!

@timholy
Copy link
Contributor

timholy commented Jan 8, 2016

Regarding StrPack, I'd be fine with adding it as a dependency. For now, forbidding broken types is a good strategy.

@maleadt
Copy link
Contributor

maleadt commented Jun 27, 2017

Much of this has gone stale/out-of-date/redundant since the move to CUDAdrv, so I'm going to close this,

@maleadt maleadt closed this Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants