ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

huh, cpu is Broadwell, not sandy/ivy
Posted by Anatoliy V Tomilov 17 Jul 2021 13:22
#include <iostream>
#include <vector>

#include <cassert>

#define cpuid(func,eax,ebx,ecx,edx)\
    __asm__ __volatile__ ("cpuid":\
    "=a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx):\
    "a" (func));


int main()
{
    {
        int a,b,c,d;
        cpuid(1,a,b,c,d);
        int extended_model = (a & 0xF0000) >> 12;
        assert(extended_model == 4 << 4);
        int family = (a & 0x0F00)>>8;
        assert(family == 6);
        int model = (a & 0xF0)>>4;
        assert(model == 15);
        int stepping = a & 0xF;
        assert(stepping == 1);
        if (__builtin_cpu_is("broadwell")) {
            std::vector<char>((1ULL << 20));
        }
    }

    int a, b;
    std::cin >> a >> b;
    std::cout << a + b << std::endl;
}
Re: huh, cpu is Broadwell, not sandy/ivy
Posted by Vladimir Yakovlev (USU) 18 Jul 2021 16:04
You're right. The CPU on the judging machine is Intel Xeon E5-2680 v4 (Broadwell). We updated the site news. Thanks for catching this.