xeon-phi

How to offload particular thread of a single app to particular Xeon Phi cores?

吃可爱长大的小学妹 提交于 2019-12-13 20:33:21
问题 Suppose I have a single c/c++ app running on the host. there are few threads running on the host CPU and 50 threads running on the Xeon Phi cores. How can I make sure that each of these 50 runs on its own Xeon Phi core and is never purged off the core cache (given the code is small enough). Could someone please to outline a very general idea how to do this and which tool/API would be more suitable (for C/C++ code) ? What is the fastest way to exchange data between the host thread-aggregator

invalid 'asm': nested assembly dialect alternatives

送分小仙女□ 提交于 2019-12-12 11:27:56
问题 I'm trying to write some inline assembly code with KNC instructions for Xeon Phi platform, using the k1om-mpss-linux-gcc compiler. I want to use a mask register into my code in order to vectorize my computation. Here it is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <assert.h> #include <stdint.h> void* aligned_malloc(size_t size, size_t alignment) { uintptr_t r = (uintptr_t)malloc(size + --alignment + sizeof(uintptr_t)); uintptr_t t = r +

Vector Sum using AVX Inline Assembly on XeonPhi

喜夏-厌秋 提交于 2019-12-11 13:15:37
问题 I am new to use XeonPhi Intel co-processor. I want to write code for a simple Vector sum using AVX 512 bit instructions. I use k1om-mpss-linux-gcc as a compiler and want to write inline assembly. Here it is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <assert.h> #include <stdint.h> void* aligned_malloc(size_t size, size_t alignment) { uintptr_t r = (uintptr_t)malloc(size + --alignment + sizeof(uintptr_t)); uintptr_t t = r + sizeof(uintptr

R Parallel Processing with Xeon Phi, minimal code changes?

ⅰ亾dé卋堺 提交于 2019-12-05 10:18:05
Looking at buying a couple Xeon Phi 5110P, but trying to estimate how much code I have to change or other software needed. Currently I make good use of R on a multi-core Windows machine (24 cores) by using the foreach package, passing it other packages forecast , glmnet , etc. to do my parallel processing. Having a Xeon Phi I understand I would want to compile R https://software.intel.com/en-us/articles/running-r-with-support-for-intel-xeon-phi-coprocessors And I understand this could be done with a trail version of Parallel Studio XE. Then do I then need to edit R's Makeconf file, adding the

segmentation fault for `vmovaps'

被刻印的时光 ゝ 提交于 2019-12-02 20:54:19
问题 I wrote a code to add two arrays using KNC instructions with (512bit long vectors) on Xeon Phi intel coprocessor. However I've got segmentation part in the inline assembly part. Here it is my code: int main(int argc, char* argv[]) { int i; const int length = 65536; const int AVXLength = length / 16; float *A = (float*) aligned_malloc(length * sizeof(float), 64); float *B = (float*) aligned_malloc(length * sizeof(float), 64); float *C = (float*) aligned_malloc(length * sizeof(float), 64); for

segmentation fault for `vmovaps'

戏子无情 提交于 2019-12-02 10:04:35
I wrote a code to add two arrays using KNC instructions with (512bit long vectors) on Xeon Phi intel coprocessor. However I've got segmentation part in the inline assembly part. Here it is my code: int main(int argc, char* argv[]) { int i; const int length = 65536; const int AVXLength = length / 16; float *A = (float*) aligned_malloc(length * sizeof(float), 64); float *B = (float*) aligned_malloc(length * sizeof(float), 64); float *C = (float*) aligned_malloc(length * sizeof(float), 64); for(i=0; i<length; i++){ A[i] = 1; B[i] = 2; } float * pA = A; float * pB = B; float * pC = C; for(i=0; i

Atomic test-and-set in x86: inline asm or compiler-generated lock bts?

混江龙づ霸主 提交于 2019-12-01 21:51:19
The below code when compiled for a xeon phi throws Error: cmovc is not supported on k1om . But it does compile properly for a regular xeon processor. #include<stdio.h> int main() { int in=5; int bit=1; int x=0, y=1; int& inRef = in; printf("in=%d\n",in); asm("lock bts %2,%0\ncmovc %3,%1" : "+m" (inRef), "+r"(y) : "r" (bit), "r"(x)); printf("in=%d\n",in); } Compiler - icc (ICC) 13.1.0 20130121 Related question: bit test and set (BTS) on a tbb atomic variable Peter Cordes IIRC, first-gen Xeon Phi is based on P5 cores (Pentium, and Pentium MMX). cmov wasn't introduced until P6 (aka Pentium Pro).

Xeon Phi Knights Corner intrinsics with GCC

旧街凉风 提交于 2019-11-28 02:15:32
I'm thinking of purchasing a Xeon Phi Knights Corner (KNC) coprocessor card . But I don't own an Intel Compiler and I have no interest in purchasing one (and the non-commercial version no longer seems to be an option). It appears that GCC is getting OpenMP support for the Xeon Phi . Is there some version of GCC or an extension to GCC that supports the KNC intrinsics ? Note that the 512-bit SIMD of the KNC is not compatible withe AVX512 (though the next version Knights Landing will be). You will have to use inline assembly rather than intrinsics to use the MIC vector instructions with GCC. The

Xeon Phi Knights Corner intrinsics with GCC

这一生的挚爱 提交于 2019-11-26 23:40:00
问题 I'm thinking of purchasing a Xeon Phi Knights Corner (KNC) coprocessor card. But I don't own an Intel Compiler and I have no interest in purchasing one (and the non-commercial version no longer seems to be an option). It appears that GCC is getting OpenMP support for the Xeon Phi. Is there some version of GCC or an extension to GCC that supports the KNC intrinsics? Note that the 512-bit SIMD of the KNC is not compatible withe AVX512 (though the next version Knights Landing will be). 回答1: You