Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:39

0001 #pragma once
0002 
0003 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0004 #include "stexture.h"
0005 
0006 MockTextureManager* MockTextureManager::INSTANCE = nullptr ; 
0007 
0008 extern "C" void QBnd_lookup_0_MOCK(
0009     cudaTextureObject_t tex, 
0010     quad4* meta, 
0011     quad* lookup, 
0012     int num_lookup, 
0013     int width, 
0014     int height 
0015     )
0016 {
0017     unsigned nx = meta->q0.u.x  ; 
0018     unsigned ny = meta->q0.u.y  ; 
0019 
0020     for(int iy=0 ; iy < height ; iy++)
0021     for(int ix=0 ; ix < width ; ix++)
0022     {
0023         int index = iy * width + ix ;
0024         float x = (float(ix)+0.5f)/float(nx) ;
0025         float y = (float(iy)+0.5f)/float(ny) ;
0026         quad q ; 
0027         q.f = tex2D<float4>( tex, x, y );     
0028 #ifdef DEBUG
0029         // debug launch config by returning coordinates 
0030         printf(" ix %d iy %d index %d nx %d ny %d x %10.3f y %10.3f \n", ix, iy, index, nx, ny, x, y ); 
0031         q.u.x = ix ; 
0032         q.u.y = iy ; 
0033         q.u.z = index ; 
0034         q.u.w = nx ; 
0035 #endif
0036         lookup[index] = q ; 
0037     }
0038 }
0039 
0040 #endif
0041 
0042