Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( mode == 2 ){//opltimal, ikj
- int lib = PAPI_library_init(PAPI_VER_CURRENT);
- if ( lib == 0 ) cout << "lib == 0\n";
- const PAPI_hw_info_t *info = PAPI_get_hardware_info();
- if (!info)
- cout << "PAPI_get_hardware_info() returns NULL\n";
- int blocksize = sqrt((info->mem_hierarchy.level[0].cache[0].size)/3);
- // cout << blocksize << endl;
- for ( i = 0; i < rows; i += blocksize ){
- for ( k = 0; k < columns; k += blocksize ){
- for ( j = 0; j < M2.columns; j += blocksize ){
- //block mult
- for ( int i1 = i; i1 < i + blocksize && i1 < rows; i1++ ){
- for ( int k1 = k; k1 < k + blocksize && k1 < M2.columns; k1++ ){
- for ( int j1 = j; j1 < j + blocksize && j1 < columns; j1++ ){
- Tmp.vals[i1][j1] += vals[i1][k1]*M2.vals[k1][j1];
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement