Created
November 4, 2016 23:23
-
-
Save kaja47/b2f7ecadd9dabb98ac2b39873c0a62de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <immintrin.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
int len = 16; | |
char* arr = malloc(1024*1024*16); | |
int stride = 1024*4; | |
// warm TLB | |
for (int i = 0; i < len; i++) { | |
arr[i*stride] = 1; | |
} | |
if (_xbegin() == -1) { | |
for (int i = 0; i < len; i++) { | |
arr[i*stride] = 1; | |
} | |
_xend(); | |
printf("success\n"); | |
} else { | |
printf("failure\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment