Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions 1. Matrix multiplication in OpenMP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.10)
project(1__Matrix_multiplication_in_OpenMP)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp")

add_executable(1__Matrix_multiplication_in_OpenMP main.cpp Matrix/Matrix.cpp Matrix/Matrix.h)
# Locate GTest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})

# Link runTests with what we want to test and the GTest and pthread library
add_executable(executeTests test/matrixTest.cpp)
target_link_libraries(executeTests ${GTEST_LIBRARIES} pthread)

add_executable(1__Matrix_multiplication_in_OpenMP main.cpp Matrix/Matrix.cpp Matrix/Matrix.h test/matrixTest.cpp)
2 changes: 2 additions & 0 deletions 1. Matrix multiplication in OpenMP/_readme_lab1.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ Task:
6) https://software.intel.com/ru-ru/articles/getting-started-with-openmp
7) https://software.intel.com/ru-ru/articles/more-work-sharing-with-openmp
8) https://en.wikipedia.org/wiki/SPMD

9) [Google tests](https://www.srcmake.com/home/google-cpp-test-framework)
1 change: 0 additions & 1 deletion 1. Matrix multiplication in OpenMP/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <stdlib.h>
#include <vector>
#include <iostream>

#include <fstream>

#include "Matrix/Matrix.h"
Expand Down
60 changes: 60 additions & 0 deletions 1. Matrix multiplication in OpenMP/test/matrixTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include <gtest/gtest.h>

#include "../Matrix/Matrix.h"

TEST(getNumRowsTest, getNumRowsTest) {
auto *matrix = new Matrix(4, 40);
ASSERT_EQ(4, matrix->getNumRows());
delete(matrix);
}

TEST(getNumColumnsTest, getNumColumnsTest) {
auto *matrix = new Matrix(4, 40);
ASSERT_EQ(40, matrix->getNumRows());
delete(matrix);
}
//
//TEST(showFirstMatrix, showFirstMatrix) {
//
//}
//
//TEST(showSecondMatrix, showSecondMatrix) {
//
//}
//
//TEST(showResultMatrix, showResultMatrix) {
//
//}
//
//TEST(getExecutingTimeWithOmp, getExecutingTimeWithOmp) {
//
//}
//
//TEST(getExecutingTimeWithoutOmp, getExecutingTimeWithoutOmp) {
//
//}
//
//TEST(multiplyTwoMatricesWithOmpDefault, multiplyTwoMatricesWithOmpDefault) {
//
//}
//
//TEST(multiplyTwoMatricesWithOmpStatic, multiplyTwoMatricesWithOmpStatic) {
//
//}
//
//TEST(multiplyTwoMatricesWithOmpDynamic, multiplyTwoMatricesWithOmpDynamic) {
//
//}
//
//TEST(multiplyTwoMatricesWithOmpGuided, multiplyTwoMatricesWithOmpGuided) {
//
//}
//
//TEST(multiplyTwoMatricesWithOmpRuntime, multiplyTwoMatricesWithOmpRuntime) {
//
//}

int main(int argc, char **argv){
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}