search for: getcpuaffinityelement

Displaying 2 results from an estimated 2 matches for "getcpuaffinityelement".

2019 Aug 31
3
Get constants of undefined types in IR
Hello all, I would like to obtain a constant that is initialized with a value of type cpu_set_t, a type which is defined by Pthreads. The problem is that a variable of this type cannot be cast to an int value, even in C source code. I tried get methods from Constant or ConstantInt classes, but with no result. How can I obtain such constant object in IR? Thank you, Iulia -------------- next
2019 Sep 03
2
Get constants of undefined types in IR
...Northover <t.p.northover at gmail.com> wrote: Adding llvm-dev back. On Tue, 3 Sep 2019 at 18:02, Iulia Stirb <iulia_s24 at yahoo.com> wrote: Thank very much you for your answer. Following the indications in your mail, I obtained one of the 16th elements as below: static cpu_set_t getCpuAffinityElement(cpu_set_t affinity, int index) { cpu_set_t mask; CPU_ZERO(&mask); for(int i = index * sizeof(unsigned long); i < (index + 1) * sizeof(unsigned long); i++) { CPU_SET(i,&mask); } CPU_AND(&affinity, &affinity, &mask); return affinity; } That looks like a weird function, but it’...