From f3b28c040cf531129f824bc2711d2980439004bb Mon Sep 17 00:00:00 2001 From: Balhau Date: Sat, 1 Dec 2018 14:03:38 +0000 Subject: [PATCH] Changes --- CMakeLists.txt | 8 ++++++ main.cpp | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 229ef39..d69334d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,13 @@ project(cpplab) +cmake_minimum_required(VERSION 2.8) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +add_subdirectory(src) add_executable(cpplab main.cpp) +add_executable(sse sse.cpp) +add_executable(c_time time.cpp) install(TARGETS cpplab RUNTIME DESTINATION bin) diff --git a/main.cpp b/main.cpp index 8bb47f1..5079ab0 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,82 @@ #include +#include "src/core/blist.h" +#include "src/core/bmath/bmath.h" +#include "src/core/avx2.h" +#include +#include + +using namespace core::bmath; +using namespace core::cpu; + int main(int argc, char **argv) { + //Iteration over class + //blist b = blist(std::string("Tudor")); + //void *lol = b.current()->value; + + int a[avx2::AVX2_INT_SIZE] = {0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,0x10}; + int b[avx2::AVX2_INT_SIZE] = {0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,0x10,0x11}; + + avx2::printAVX2Num(a); + avx2::printAVX2Num(b); + + avx2::avx_sum(a,b); + + BMath bm1 = BMath(); + BMath bm2; + u_int64_t c1 = bm1.sum(1,2); + + + + char* input[1024]; + std::string str=std::string(); + + for(int i=0; i<1024*1024*50; i++){ + BMath* bm2=new BMath(); + c1=c1+bm2->sum(c1,i); + delete bm2; + } + + + + + std::cout << "Computed stuff" << std::endl; + std::cin >> str; + + + + std::cout << "Input: " << str << std::endl; + + std::cout << "Cena1: " << c1 << std::endl; + + blist list = blist(); + std::cout << "List size: " << list.getSize() <value << std::endl; + + int *values = list.values(); + for(int i=0;i n = node(2); + + //std::cout << "Hello node: " << ni->value << endl; + + /* + std::cout << "Hello node: " << ni->value << endl; std::cout << "Hello, world!" << std::endl; + std::cout << "Hello Blist: " << "Hello" << std::endl; + + //Template structs + struct node stringNode; + stringNode.value = std::string("Hello Master"); + + std::cout << stringNode.value << std::endl; + */ + return 0; }