| 200 | } |
| 201 | |
| 202 | static ssize_t |
| 203 | generator( |
| 204 | char *buf, |
| 205 | size_t buflen, |
| 206 | const struct SubproblemDim *subdims, |
| 207 | const struct PGranularity *pgran, |
| 208 | void *extra) |
| 209 | { |
| 210 | DUMMY_ARGS_USAGE_2(pgran, subdims); |
| 211 | char tempTemplate[32*1024]; |
| 212 | |
| 213 | if ( buf == NULL) // return buffer size |
| 214 | { |
| 215 | buflen = (32 * 1024 * sizeof(char)); |
| 216 | return (ssize_t)buflen; |
| 217 | } |
| 218 | CLBLASKernExtra *extraFlags = ( CLBLASKernExtra *)extra; |
| 219 | |
| 220 | #ifdef DEBUG_COPY |
| 221 | printf("COPY GENERATOR called....\n"); |
| 222 | printf("dataType : %c\n", Prefix[extraFlags->dtype]); |
| 223 | #endif |
| 224 | |
| 225 | unsigned int vecLenA = extraFlags->vecLenA; |
| 226 | |
| 227 | #ifdef DEBUG_COPY |
| 228 | printf("Vector length used : %d\n\n", vecLenA); |
| 229 | #endif |
| 230 | |
| 231 | bool doVLOAD = false; |
| 232 | if( extraFlags->flags & KEXTRA_NO_COPY_VEC_A ) |
| 233 | { |
| 234 | doVLOAD = true; |
| 235 | #ifdef DEBUG_COPY |
| 236 | printf("DOing VLOAD as Aligned Data Pointer not Availabe\n"); |
| 237 | #endif |
| 238 | } |
| 239 | else |
| 240 | { |
| 241 | #ifdef DEBUG_COPY |
| 242 | printf("Using Aligned Data Pointer .........................\n"); |
| 243 | #endif |
| 244 | } |
| 245 | strcpy( tempTemplate, (char*)copy_kernel ); |
| 246 | kprintf kobj( Prefix[extraFlags->dtype], vecLenA, doVLOAD, doVLOAD); |
| 247 | kobj.spit((char*)buf, tempTemplate); |
| 248 | |
| 249 | return (32 * 1024 * sizeof(char)); |
| 250 | } |
| 251 | |
| 252 | /* |
| 253 | __kernel void %PREFIXcopy_kernel( __global %TYPE *_X, __global %TYPE *_Y, |