1
Vote

Checked statements are not supported

description

Hello Genlemen,

I encountered this problem when trying to run a kernel. Exception description states :
"Checked statements are not supported"
when the following line is executing
"km = CudafyTranslator.Cudafy"
What bothers me is the fact that this error goes away when I change the type of "x" and "y" from "Integer" VN.NET for signed 4-byte integer) to "Long" (signed 8-byte integer) in this piece of code.
<Cudafy>
    Private Sub MRecalcKernel(trd As GThread, Field(,) As Integer, FieldNew(,) As Integer)
        Dim x As Integer = trd.threadIdx.x + trd.blockIdx.x * trd.blockDim.x
        Dim y As Integer = trd.threadIdx.y + trd.blockIdx.y * trd.blockDim.y
    End Sub
Anyway this problem is present in every more complicated kernel that I write and it's driving me crazy because I don't understand what is going on. Can somebody help me with this issue?

The ultimate goal is to execute a kernel like this (maybe you'll spot my mistake here):
    <Cudafy>
    Private Sub MRecalcKernel(trd As GThread, Field(,) As Integer, FieldNew(,) As Integer)
        Dim x As Integer = trd.threadIdx.x + trd.blockIdx.x * trd.blockDim.x
        Dim y As Integer = trd.threadIdx.y + trd.blockIdx.y * trd.blockDim.y
        If x = 0 Or y = 0 Or x = UBound(Field, 0) Or y = UBound(Field, 1) Then
            FieldNew(x, y) = Field(x, y)
        Else
            FieldNew(x, y) = (Field(x - 1, y - 1) + Field(x, y - 1) + Field(x + 1, y - 1) + Field(x - 1, y) + Field(x + 1, y) + Field(x - 1, y + 1) + Field(x, y + 1) + Field(x + 1, y + 1)) / 8
        End If
    End Sub
PS:
I've tried to turn off compiler overflow checks in Visual Studio in which case I receive:
"The 'compute_20', 'sm_20' and 'sm_21' architectures are deprecated, and may be removed in a future releaste (Use -Wno-deprecated-gpu-targets to suppress warning)."
I use
  • Win10
  • Visual Studio 2013
  • Cudafy 1.29
  • Latest GeForce drivers to-date

comments