Skip to content

Instantly share code, notes, and snippets.

@xianyi
Created February 19, 2014 13:01
Show Gist options
  • Save xianyi/9091495 to your computer and use it in GitHub Desktop.
Save xianyi/9091495 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#ifndef unlikely
#ifdef __GNUC__
#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define unlikely(x) (x)
#endif
#endif
#ifndef likely
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
#else
#define likely(x) (x)
#endif
#endif
void blas_thread_init(){
printf("ok\n");
}
void main(int argc, char** argv)
{
int i=0;
int blas_server_avail=0;
blas_server_avail=atoi(argv[1]);
if(unlikely(blas_server_avail==0)){
i++;
blas_thread_init();
}
i-=2;
printf("%d\n",i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment