from cudaTestProgram import * 

spatialOffsetReadTests = [
    CudaTestProgram("spatial_offset/global_device_alloc_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R,'-o','-1000'),
            CudaTestCase(CudaError.GLB_R,'-o','-1'),
            CudaTestCase(CudaError.GLB_R,'-o','1'),
            CudaTestCase(CudaError.GLB_R,'-o','1000'),
        ]),
    CudaTestProgram("spatial_offset/global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1000','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1000','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_host_alloc_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R,'-o','-1000'),
            CudaTestCase(CudaError.GLB_R,'-o','-1'),
            CudaTestCase(CudaError.GLB_R,'-o','1'),
            CudaTestCase(CudaError.GLB_R,'-o','1000'),
        ]),
    CudaTestProgram("spatial_offset/global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1000','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1000','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/local_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.LCL_R,'-o','-1000'),
            CudaTestCase(CudaError.LCL_R,'-o','-1'),
            CudaTestCase(CudaError.LCL_R,'-o','1'),
            CudaTestCase(CudaError.LCL_R,'-o','1000'),
        ]),
    CudaTestProgram("spatial_offset/local_offset.cu",
        macros={'R':None,'OFFSET':'-1000','ACCESS_DIR':'0'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.LCL_R),
        ]),
    CudaTestProgram("spatial_offset/local_offset.cu",
        macros={'R':None,'OFFSET':'-1','ACCESS_DIR':'0'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.LCL_R),
        ]),
    CudaTestProgram("spatial_offset/local_offset.cu",
        macros={'R':None,'OFFSET':'1','ACCESS_DIR':'1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.LCL_R),
        ]),
    CudaTestProgram("spatial_offset/local_offset.cu",
        macros={'R':None,'OFFSET':'1000','ACCESS_DIR':'1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.LCL_R),
        ]),
    CudaTestProgram("spatial_offset/pitched_ptr.cu",
        macros={'R':None,'ACCESS_MODE':'-1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/pitched_ptr.cu",
        macros={'R':None,'ACCESS_MODE':'0'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/pitched_ptr.cu",
        macros={'R':None,'ACCESS_MODE':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/shared_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R,'-o','-1000'),
            CudaTestCase(CudaError.SHR_R,'-o','-1'),
            CudaTestCase(CudaError.SHR_R,'-o','1'),
            CudaTestCase(CudaError.SHR_R,'-o','1000'),
        ]),
    CudaTestProgram("spatial_offset/shared_extern_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R,'-o','-1000'),
            CudaTestCase(CudaError.SHR_R,'-o','-1'),
            CudaTestCase(CudaError.SHR_R,'-o','1'),
            CudaTestCase(CudaError.SHR_R,'-o','1000'),
        ]),
    CudaTestProgram("spatial_offset/shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'-1000','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'-1','ACCESS_DIR':'0'},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'1','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'1000','ACCESS_DIR':'1'},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_offset.cu",
        macros={'R':None,'OFFSET':'-1000','ACCESS_DIR':'0'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_offset.cu",
        macros={'R':None,'OFFSET':'-1','ACCESS_DIR':'0'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_offset.cu",
        macros={'R':None,'OFFSET':'1','ACCESS_DIR':'1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/shared_offset.cu",
        macros={'R':None,'OFFSET':'1000','ACCESS_DIR':'1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.SHR_R),
        ]),
    CudaTestProgram("spatial_offset/struct_global_device_alloc_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R,'-o','-1'),
            CudaTestCase(CudaError.GLB_R,'-o','1'),
        ]),
    CudaTestProgram("spatial_offset/struct_global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_global_device_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_global_host_alloc_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R,'-o','-1'),
            CudaTestCase(CudaError.GLB_R,'-o','1'),
        ]),
    CudaTestProgram("spatial_offset/struct_global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'-1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_global_host_alloc_offset.cu",
        macros={'R':None,'OFFSET':'1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R,'-o','-1'),
            CudaTestCase(CudaError.SHR_R,'-o','1'),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_extern_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.SHR_R,'-o','-1'),
            CudaTestCase(CudaError.SHR_R,'-o','1'),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'-1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_extern_offset.cu",
        macros={'R':None,'OFFSET':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_offset.cu",
        macros={'R':None,'OFFSET':'-1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_shared_offset.cu",
        macros={'R':None,'OFFSET':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_local_dynamic_args.cu",
        macros={'R':None},
        testCases=[ 
            CudaTestCase(CudaError.LCL_R,'-o','-1'),
            CudaTestCase(CudaError.LCL_R,'-o','1'),
        ]),
    CudaTestProgram("spatial_offset/struct_local_offset.cu",
        macros={'R':None,'OFFSET':'-1'},
        expectedCompilerWarnings=[CudaWarning.SUB_OOR],
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/struct_local_offset.cu",
        macros={'R':None,'OFFSET':'1'},
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/two_array_global.cu",
        macros={'R':None,'ACCESS_DIR':'0'}, #fwd, because NVCC strips string defines
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
    CudaTestProgram("spatial_offset/two_array_global.cu",
        macros={'R':None,'ACCESS_DIR':'1'}, #bck, because NVCC strips string defines
        testCases=[ 
            CudaTestCase(CudaError.GLB_R),
        ]),
]
