From 11378e5ea60d5fd04af99088bb55843b3ecc1e20 Mon Sep 17 00:00:00 2001 From: Balhau Date: Sat, 1 Dec 2018 14:09:07 +0000 Subject: [PATCH] Added gitignore --- .gitignore | 12 ++++ clab/hello | Bin 0 -> 8519 bytes clab/hello.c | 5 ++ clab/module.c | 7 +++ src/CMakeLists.txt | 2 + src/core/CMakeLists.txt | 0 src/core/avx2.cpp | 28 +++++++++ src/core/avx2.h | 19 ++++++ src/core/blist.cpp | 22 +++++++ src/core/blist.h | 111 ++++++++++++++++++++++++++++++++++ src/core/bmath/CMakeLists.txt | 0 src/core/bmath/bmath.h | 27 +++++++++ sse.cpp | 8 +++ time.cpp | 36 +++++++++++ 14 files changed, 277 insertions(+) create mode 100644 .gitignore create mode 100755 clab/hello create mode 100644 clab/hello.c create mode 100644 clab/module.c create mode 100644 src/CMakeLists.txt create mode 100644 src/core/CMakeLists.txt create mode 100644 src/core/avx2.cpp create mode 100644 src/core/avx2.h create mode 100644 src/core/blist.cpp create mode 100644 src/core/blist.h create mode 100644 src/core/bmath/CMakeLists.txt create mode 100644 src/core/bmath/bmath.h create mode 100644 sse.cpp create mode 100644 time.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3657e18 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +bin/ +*.dis +*.o +.kdev4/ +.vscode/ +CMakeFiles/ +**/CMakeFiles/ +CMakeCache.txt +Makefile +*.cmake +build/ + diff --git a/clab/hello b/clab/hello new file mode 100755 index 0000000000000000000000000000000000000000..9912a45b884d5b045e73885ebddcb13de95e9cd2 GIT binary patch literal 8519 zcmeHMZERat89ug?CS6;{EoJlCt+Aj**{0kjZI)$JW!L%Yb(OTGbuvwm-Z-(-c=JbO zU$5y9C6INJ1sw>XDMLc^XCH0bqs1ShZfiXcsI&?RJFg_zweRfYA4^+Fdr z#CEX`NF)BbEFo#e;v{qkCs zWJ~Gr6)R5pl4@kBQ70I>ExV*91WV?96+DXbZc{)R9#Qq(sb6lY_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9P=x1lD<97+3s|s+jgU zXZ#8l&m%*9%KSN>E{otoZKw-28Jceo689yO)mfy#!?x@UP9+wZmb=J@C;Z~?oNbY!9XL$oQPQFmj5&WXBLwc!Rn8%XF$I0(d z{0+$NV3VqmZ zqjhngu_v2aI`nKi1*66Owsf<iK_9Qn##{5B7e& zdfe^%4TM{M1J8E=Ki5Wz2PDA(BRU2|)*6`{StmfU4`x52R*7o{N + +int main(int argc,char **argv){ + printf("Hello world\n"); +} \ No newline at end of file diff --git a/clab/module.c b/clab/module.c new file mode 100644 index 0000000..78af404 --- /dev/null +++ b/clab/module.c @@ -0,0 +1,7 @@ +#include + +int hijackMethod(){ + printf("This should never be called"); + printf("Neither this..."); + return 0; +} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..232c827 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_subdirectory(core) \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/core/avx2.cpp b/src/core/avx2.cpp new file mode 100644 index 0000000..c1d8247 --- /dev/null +++ b/src/core/avx2.cpp @@ -0,0 +1,28 @@ +#include "avx2.h" +#include +#include + +using namespace core::cpu; + +namespace core{ + namespace cpu{ + void avx2::naive_sum(int *a,int *b){ + for(int i=0;i + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "blist.h" +#include +#include + + diff --git a/src/core/blist.h b/src/core/blist.h new file mode 100644 index 0000000..092ce79 --- /dev/null +++ b/src/core/blist.h @@ -0,0 +1,111 @@ +/* + * Copyright 2017 Vitor Fernandes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef BLIST_H +#define BLIST_H + +#include +#include +#include + +template +class blist +{ +public: + + typedef struct node{ + node(T v,node* p,node* n){ + value = v; + next = n; + previous = p; + } + node(T v){ + value=v; + next=NULL; + previous=NULL; + } + T value; + node* next; + node* previous; + } Node; + + blist(){ + this->rootNode = NULL; + this->currentNode=this->rootNode; + size = 0; + }; + blist(T value){ + this->rootNode=new Node(value,NULL,NULL); + this->currentNode=this->rootNode; + size = 1; + }; + blist(const blist& other){ + this->rootNode = other.root(); + }; + void add(T value){ + if(this->rootNode==NULL){ + this->rootNode=new Node(value,NULL,NULL); + this->currentNode=rootNode; + }else{ + Node* newNode = new Node(value,currentNode,NULL); + this->currentNode->next = newNode; + currentNode=newNode; + } + size++; + }; + ~blist(){ + std::cout << "Destructing list" << std::endl; + Node *aux; + while(this->currentNode!=this->rootNode){ + aux = this->currentNode; + this->currentNode = this->currentNode->previous; + delete aux; + } + delete this->rootNode; + }; + blist& operator=(const blist& other){ + this->rootNode = other.root(); + }; + bool operator==(const blist& other){ + this->rootNode==other.root(); + }; + Node * root() const { + return this->rootNode; + }; + Node * current() const { + return this->currentNode; + }; + + T* values() { + T *aux = new T[size]; + Node *naux = this->rootNode; + for(int i=0;ivalue; + naux=naux->next; + } + return aux; + }; + int getSize(){ + return size; + }; +private: + Node * rootNode; + Node * currentNode; + int size; +}; + +#endif // BLIST_H diff --git a/src/core/bmath/CMakeLists.txt b/src/core/bmath/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/core/bmath/bmath.h b/src/core/bmath/bmath.h new file mode 100644 index 0000000..756990f --- /dev/null +++ b/src/core/bmath/bmath.h @@ -0,0 +1,27 @@ +#ifndef BALHAU_CORE_BMATH +#define BALHAU_CORE_BMATH + +#include +#include + +namespace core { + namespace bmath { + class BMath { + public: + BMath(){ + //std::cout << "Constructor BMath called" << std::endl; + } + u_int64_t sum(u_int64_t a,u_int64_t b){ + return a+b; + } + + + + ~BMath(){ + //std::cout<< "Destructor BMath called" << std::endl; + } + + }; + }; +} +#endif \ No newline at end of file diff --git a/sse.cpp b/sse.cpp new file mode 100644 index 0000000..8339866 --- /dev/null +++ b/sse.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + + +int main(int argc, char** argcv){ + +} \ No newline at end of file diff --git a/time.cpp b/time.cpp new file mode 100644 index 0000000..a801003 --- /dev/null +++ b/time.cpp @@ -0,0 +1,36 @@ +#include +#include +#include + +#include +#include + +void errExit(const char *msg){ + printf("ERROR: %s",msg); + exit(1); +} + +static void displayProcessTimes(const char *msg){ + struct tms t; + clock_t clockTime; + static long clockTicks = 0; + + if(msg != NULL) + printf("%s",msg); + + if(clockTicks==0){ + clockTicks=sysconf(_SC_CLK_TCK); + + if(clockTicks==-1) errExit("sysconf"); + } + + clockTime=clock(); + if(clockTime==-1) errExit("clockTime"); + + printf("clock() returns %ld clocks-per-sec (%.2f secs)\n",(long) clockTime,(double) clockTime); +}; + +int main(int argc,char* argv[], char* env[]){ + printf("Kie kie\n"); + +} \ No newline at end of file