mirror of
https://github.com/clearlinux/make-fmv-patch.git
synced 2026-09-03 20:32:00 +00:00
Add support for cpp files with test examples
Fix https://github.com/clearlinux/make-fmv-patch/issues/2 Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
all:
|
||||
gcc -O2 -ftree-vectorize loop-test.c -o loop-test -fopt-info-vec &> loop-build.log
|
||||
g++ -O2 -ftree-vectorize max-test.cpp -o max-test -fopt-info-vec &> max-build.log
|
||||
clean:
|
||||
@find . -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print | xargs rm -f
|
||||
distclean:
|
||||
@rm -rf *.c.patch
|
||||
@rm -rf *.cpp.patch
|
||||
@rm -rf *build.log
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#define MAX 1000000
|
||||
|
||||
static struct timeval tm1;
|
||||
int a[256], b[256], c[256];
|
||||
|
||||
void foo();
|
||||
|
||||
int main(){
|
||||
foo();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void foo(){
|
||||
int i,x;
|
||||
for (x=0; x<MAX; x++){
|
||||
for (i=0; i<256; i++){
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int max(int num1, int num2);
|
||||
void foo();
|
||||
|
||||
int a[256], b[256];
|
||||
|
||||
int main () {
|
||||
foo();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void foo(){
|
||||
|
||||
int i;
|
||||
for (i=0; i<256; i++){
|
||||
a[i] = 100;
|
||||
b[i] = 200;
|
||||
}
|
||||
|
||||
int ret;
|
||||
for (i=0; i<256; i++){
|
||||
ret = max(a[i], b[i]);
|
||||
cout << "Max value is : " << ret << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int max(int num1, int num2) {
|
||||
int result;
|
||||
if (num1 > num2)
|
||||
result = num1;
|
||||
else
|
||||
result = num2;
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user