It kind of looks like something is walking 4 values at a time, or at least that's part of what's going on. I'm still looking into it but I figured it was worth posting (in case the single-channel-order isn't working yet or something).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There's no way to write less than a float4 though. That's what the API takes.
For reading, it specifies what you get in the float4 (I.E. in "R" order you get "value, 0, 0, 1") so I am assuming it works the same with writing ("value, ignored, ignored, ignored") which is what seems to be the case, if you look at my output there are no 200, 300, or 400 values).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're right. I had the impression write_image and read_image take different vectors for different image formats. But then no float3 exists so it wouldn't work in all cases.
Maybe it's a readback problem? How do you retrieve the resulting array?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you're running ATI Stream and hit this issue, consider upgrading to a newer (Stream) version. Previous versions (<2.2) had no support for single channel images.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use single-channel image2ds, and getting odd results.
Here's the relevant bit of my kernel:
Here's what I get in my array back in C# after the read:
It kind of looks like something is walking 4 values at a time, or at least that's part of what's going on. I'm still looking into it but I figured it was worth posting (in case the single-channel-order isn't working yet or something).
Oh sorry, forgot to say "b" is an image2d_t created with:
You're declaring an image with a single float per pixel (R) but writing four floats per pixel (as in RGBA). That's my bet.
There's no way to write less than a float4 though. That's what the API takes.
For reading, it specifies what you get in the float4 (I.E. in "R" order you get "value, 0, 0, 1") so I am assuming it works the same with writing ("value, ignored, ignored, ignored") which is what seems to be the case, if you look at my output there are no 200, 300, or 400 values).
You're right. I had the impression write_image and read_image take different vectors for different image formats. But then no float3 exists so it wouldn't work in all cases.
Maybe it's a readback problem? How do you retrieve the resulting array?
If you're running ATI Stream and hit this issue, consider upgrading to a newer (Stream) version. Previous versions (<2.2) had no support for single channel images.