Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
Announcements
Important Update: Community Platform Migration​. Learn more​>

GEN13: Lower performance compared to I7

zvivered1
Beginner
1,351 Views

Hello,

 

I wrote a simple code that converts a 3D int16_t complex matrix (X0 * Y0 *Z0) into ZO 2D float complex matrices using intrinsic code and last version of Intel compiler (2025.3).   

 

I ran the binary under "12th Gen Intel(R) Core(TM) i5-12500" running Mint 22.1 and also under "13th Gen" running the same Mint.

For some reason, the older PC (12th) ran the code faster. 

Does it make sense ?

 

Is it possible to force the CPU to run the code on a P-Core and not E-core ?

 

Attached the Makefile + c code. 

Please note - I'm not asking for help in optimising my code.  I just want to understand how can I use the 13th Gen smartly. 

 

Thank you,

Zvi Vered 

0 Kudos
1 Reply
Sravani_K_Intel
Moderator
778 Views

Some reasons why 13th Gen might be slower:

  1. Thread Scheduler Issues: Intel's Thread Director (hardware thread scheduler) in hybrid architectures can sometimes migrate your compute-intensive threads to E-cores (Efficiency cores), which are significantly slower than P-cores (Performance cores) for demanding workloads.

  2. E-core characteristics:

    • 12th Gen i5-12500: 6 P-cores, 0 E-cores (pure P-core design)
    • 13th Gen variants: Mix of P-cores and E-cores
    • E-cores lack AVX-512 and have lower clock speeds
    • Your code uses AVX2 intrinsics (_mm256_*, _mm_*) which benefit from P-cores
  3. Memory/Cache contention: E-cores and P-cores share some cache levels, potentially causing contention.

Forcing execution on P-cores is a viable solution.

An easy way to do that is using taskset:

# Find your CPU topology first
lscpu --extended

# Then run with taskset (example for cores 0-11 being P-cores)
taskset -c 0-11 ./exe

For a permanent solution, you can use pthread_setaffinity_np . Add this to your code (works on Linux):

#define _GNU_SOURCE
#include <pthread.h>
#include <sched.h>

void set_cpu_affinity_to_p_cores() {
    cpu_set_t cpuset;
    CPU_ZERO(&cpuset);
    
    // For 13th gen i5-13xxx with 6 P-cores (12 threads with HT)
    // P-cores are typically cores 0-11 (assuming 6 P-cores with hyperthreading)
    // You need to check your specific CPU topology
    for (int i = 0; i < 12; i++) {  // Adjust based on your CPU
        CPU_SET(i, &cpuset);
    }
    
    pthread_t current_thread = pthread_self();
    pthread_setaffinity_np(current_thread, sizeof(cpu_set_t), &cpuset);
}

// Call this at the start of your main function

 

 

0 Kudos
Reply