I used some testing using texture memory.
But randomly texture memory gives me wrong answer and it differents.
Is there some noise in the texture memory?
41 global void non_coalesced_read_kernel(uint32_t* in, uint32_t* out, uint32_t d_data_size) {
42 uint32_t idx = threadIdx.x + blockDim.x * blockIdx.x;
43 uint32_t stride = d_data_size / blockDim.x;
44
45 for(uint32_t i = 0; i < stride; i ++) {
46 out[idx * stride + i] = in[idx * stride + i];
47 }
48 }
50 global void texture_non_coalesced_read_kernel(uint32_t* in, uint32_t* out, uint32_t d_data_size) {
51 uint32_t idx = threadIdx.x + blockDim.x * blockIdx.x;
52 uint32_t stride = d_data_size / blockDim.x;
53
54 for(uint32_t i = 0; i < stride; i ++) {
55 out[idx * stride + i] = tex1Dfetch(texRef, idx * stride + i);
56 }
57 }
That non_coalesed_read_kernel gives me write answer but texture_non_coalesced_read_kernel is not.
It gives me wrong data. But it is not fixed, it is random.
WRONG at 133067th in : 1558785803 & out : 1558785795
WRONG at 235964th in : 1913191054 & out : 2047408782
WRONG at 305974th in : 1218669696 & out : 1218669568
WRONG at 328493th in : 2044923189 & out : 2028145973
WRONG at 407561th in : 1738743152 & out : 1201872240
WRONG at 626524th in : 2053866288 & out : 1516995376
WRONG at 1575084th in : 1188393243 & out : 1188327707
WRONG at 1813923th in : 778369801 & out : 241498889
WRONG at 1837378th in : 802871716 & out : 802855332
WRONG at 2492792th in : 616311277 & out : 616311021
WRONG at 2701133th in : 1669117148 & out : 1669108956
WRONG at 2708354th in : 1036837659 & out : 1036821275
WRONG at 2740284th in : 2115471622 & out : 2115209478
WRONG at 3049996th in : 515370208 & out : 515304672
WRONG at 3209228th in : 1363142440 & out : 1363076904
WRONG at 3284301th in : 1025962441 & out : 1025954249
WRONG at 3289570th in : 1843714571 & out : 1843698187
WRONG at 3299679th in : 2123562597 & out : 2123431525
WRONG at 3306681th in : 917384852 & out : 648949396
WRONG at 3316598th in : 1918251770 & out : 1918251642
WRONG at 3325268th in : 201277202 & out : 201276690
WRONG at 3814369th in : 1878481924 & out : 1341611012
WRONG at 4028162th in : 1062664525 & out : 1062656333
WRONG at 4099724th in : 725422304 & out : 725356768
WRONG at 4116985th in : 848604457 & out : 580169001
WRONG at 4186060th in : 1772046098 & out : 1771980562
WRONG at 397185th in : 709442834 & out : 172571922
WRONG at 551404th in : 20000851 & out : 19935315
WRONG at 1492188th in : 1644432145 & out : 1644170001
WRONG at 1575084th in : 1948589030 & out : 1948523494
WRONG at 1657260th in : 910645422 & out : 910579886
WRONG at 1837378th in : 1778926922 & out : 1778910538
WRONG at 2074060th in : 1087726249 & out : 1087660713
WRONG at 2145102th in : 397442416 & out : 389053808
WRONG at 2145137th in : 2112142158 & out : 2111880014
WRONG at 2512089th in : 1008833460 & out : 740398004
WRONG at 2595490th in : 213188029 & out : 213171645
WRONG at 2885724th in : 1961485832 & out : 2095703560
WRONG at 2924172th in : 743165881 & out : 743100345
WRONG at 2986475th in : 217284191 & out : 217284183
WRONG at 3004034th in : 1313528617 & out : 1313512233
WRONG at 3049996th in : 1448438349 & out : 1448372813
WRONG at 3073387th in : 2068498265 & out : 2067973977
WRONG at 3109367th in : 65281447 & out : 65019303
WRONG at 3159979th in : 270761516 & out : 270761508
WRONG at 3407686th in : 577538289 & out : 40667377
WRONG at 3424697th in : 966597697 & out : 698162241
WRONG at 3986969th in : 946420128 & out : 677984672
WRONG at 4107181th in : 1106881062 & out : 1106872870
WRONG at 4132070th in : 2016696697 & out : 1479825785
Could you help me?