Skip to content

Instantly share code, notes, and snippets.

@danilaml
danilaml / test.h
Created February 8, 2019 00:28
Test pragma
#pragma clang system_header
#pragma GCC system_header
int i = {0.0};
@danilaml
danilaml / mandelbrot_out.txt
Created September 30, 2018 01:34
GPGPU Task2 (3?)
OpenCL devices:
Device #0: CPU. Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz. Intel(R) Corporation. Total memory: 6067 Mb
Device #1: CPU. Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz. Intel(R) Corporation. Total memory: 6067 Mb
Device #2: GPU. Intel(R) HD Graphics 4400. Total memory: 1629 Mb
Using device #2: GPU. Intel(R) HD Graphics 4400. Total memory: 1629 Mb
CPU: 1.3125+-0.0199478 s
CPU: 8.18089 GFlops
Real iterations fraction: 56.2638%
Недопустимый параметр: 100
GPU: 0.075+-0 s
template<typename... Args> safe_buffers std::string format(const char* fmt, Args... args)
{
std::unique_ptr<char[]> buf(new char[4096]);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"
const std::size_t len = snprintf(buf.get(), 4096, fmt, do_unveil(args)...) + 1;
if (len > 4096) {
buf.reset(new char[len]);
snprintf(buf.get(), len, fmt, do_unveil(args)...);
}
Recompiling block :
001d85b8: 00 00 00 00 stdu r1,-128(r1) #ffffff80
001d85bc: 00 00 00 00 mflr r0
001d85c0: 00 00 00 00 std r31,120(r1) #78
001d85c4: 00 00 00 00 std r0,144(r1) #90
001d85c8: 00 00 00 00 mr r31,r3
001d85cc: 00 00 00 00 lwz r0,552(r3) #228
001d85d0: 00 00 00 00 extsw r9,r0
001d85d4: 00 00 00 00 li r0,0 #0
Running test MTOCRF.0
LLVM IR:
define x86_64_win64cc i32 @MTOCRF.0(i8* %ppu_state, i64 %context) {
start:
%0 = getelementptr i8* %ppu_state, i32 768
%1 = bitcast i8* %0 to i32*
%2 = load i32* %1, align 8
%3 = getelementptr i8* %ppu_state, i32 1540
%4 = bitcast i8* %3 to i32*
%5 = load i32* %4, align 4