Skip to content
Discussion options

You must be logged in to vote

You can't access gridSize1 until after it has been assigned, which in your expression isn't until after the with expression which is why it's not accessible there.

If you assign the variable first you can use with in this manner:

 var gridSize1 = new CudaGridBlockSize
            {
                BlocksizeX = 64,
                BlocksizeY = 1,
                BlocksizeZ = 1
            } ;
  gridSize1 = gridSize1 with
            {
                GridsizeX = ((width - 1) / gridSize1.BlocksizeX / 4) + 1,
                GridsizeY = ((height - 1) / gridSize1.BlocksizeY) + 1,
                GridsizeZ = ((depth - 1) / gridSize1.BlocksizeZ) + 1
            };

There is a separate issue wher…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@msedi
Comment options

Answer selected by msedi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants