unsigned id;
struct anv_block_pool *pool;
int32_t blocks[BLOCKS_PER_THREAD];
- int32_t back_blocks[BLOCKS_PER_THREAD];
} jobs[NUM_THREADS];
*data = block;
ASSERT(block >= 0);
job->blocks[i] = block;
-
- block = anv_block_pool_alloc_back(job->pool, block_size);
- data = anv_block_pool_map(job->pool, block, block_size);
- *data = block;
- ASSERT(block < 0);
- job->back_blocks[i] = -block;
}
for (unsigned i = 0; i < BLOCKS_PER_THREAD; i++) {
block = job->blocks[i];
data = anv_block_pool_map(job->pool, block, block_size);
ASSERT(*data == block);
-
- block = -job->back_blocks[i];
- data = anv_block_pool_map(job->pool, block, block_size);
- ASSERT(*data == block);
}
return NULL;
block_ptrs[i] = jobs[i].blocks;
validate_monotonic(block_ptrs);
- /* Validate that the back block allocations were monotonic */
- for (unsigned i = 0; i < NUM_THREADS; i++)
- block_ptrs[i] = jobs[i].back_blocks;
- validate_monotonic(block_ptrs);
-
anv_block_pool_finish(&pool);
anv_bo_cache_finish(&device.bo_cache);
pthread_mutex_destroy(&device.mutex);