You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it's possible. To be short, cuda device doesn't support any form of exception handling. If an error happened on the device side, there's no way to recover from it.
The only solution is to avoid the error from happening before you execute it on the device.
Question
private static void test(Index1D d, ArrayView view)
{
view[-d ] = 3/d; /// error
}
public static unsafe void Main(string[] args)
{
var ctx = Context.Create (c=>c.AllAccelerators().EnableAlgorithms().Optimize(OptimizationLevel.O2).Inlining(InliningMode.Aggressive));
var a = ctx.CreateCudaAccelerator(0);
var ttt = a.LoadAutoGroupedKernel<Index1D, ArrayView>(test);
var ccc = a.Allocate1D(10);
try
{
ttt(a.DefaultStream, 1000, ccc.View);
a.DefaultStream.Synchronize();
}
catch (AcceleratorException e)
{
CudaAPI.CurrentAPI.DestroyContext((a as CudaAccelerator).NativePtr);
a = ctx.CreateCudaAccelerator(0); /// ILGPU.Runtime.Cuda.CudaException: "an illegal memory access was encountered"
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: