mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-18 21:36:27 +00:00
gem_gtt_speed: Use a memset() to test streaming performance
This make the reasonable assumption that the libc code for memset() can saturate the memory bandwidth -- at any rate it should do better than the copy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
efd68f9d64
commit
f256ada3b6
@ -133,6 +133,16 @@ int main(int argc, char **argv)
|
||||
gettimeofday(&end, NULL);
|
||||
printf("Time to write %dk through a CPU map: %7.3fµs\n",
|
||||
size/1024, elapsed(&start, &end, loop));
|
||||
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
memset(base, 0, size);
|
||||
munmap(base, size);
|
||||
}
|
||||
gettimeofday(&end, NULL);
|
||||
printf("Time to clear %dk through a CPU map: %7.3fµs\n",
|
||||
size/1024, elapsed(&start, &end, loop));
|
||||
}
|
||||
|
||||
/* CPU pwrite */
|
||||
@ -200,6 +210,17 @@ int main(int argc, char **argv)
|
||||
printf("Time to write %dk through a GTT map: %7.3fµs\n",
|
||||
size/1024, elapsed(&start, &end, loop));
|
||||
|
||||
/* mmap clear */
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
memset(base, 0, size);
|
||||
munmap(base, size);
|
||||
}
|
||||
gettimeofday(&end, NULL);
|
||||
printf("Time to clear %dk through a GTT map: %7.3fµs\n",
|
||||
size/1024, elapsed(&start, &end, loop));
|
||||
|
||||
/* mmap read */
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user