working need to put in shape of pi
This commit is contained in:
@@ -9,6 +9,9 @@ add_executable(ComputePi
|
|||||||
main.cpp
|
main.cpp
|
||||||
computePi.cpp
|
computePi.cpp
|
||||||
computePi.hpp
|
computePi.hpp
|
||||||
|
Map.cpp
|
||||||
|
Map.hpp
|
||||||
|
FifoQueue.cpp
|
||||||
|
FifoQueue.hpp
|
||||||
# Add files implementing your thread-safe data structures below
|
# Add files implementing your thread-safe data structures below
|
||||||
)
|
)
|
||||||
|
|||||||
22
FifoQueue.cpp
Normal file
22
FifoQueue.cpp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#include "FifoQueue.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
void FifoQueue::pop(){
|
||||||
|
std::lock_guard<std::mutex> lock(qMutex);
|
||||||
|
FifoQueue.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FifoQueue::empty(){
|
||||||
|
std::lock_guard<std::mutex> lock(qMutex);
|
||||||
|
return FifoQueue.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void FifoQueue::push(int i){
|
||||||
|
std::lock_guard<std::mutex> lock(qMutex);
|
||||||
|
FifoQueue.push(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int FifoQueue::front(){
|
||||||
|
std::lock_guard<std::mutex> lock(qMutex);
|
||||||
|
return FifoQueue.front();
|
||||||
|
}
|
||||||
16
FifoQueue.hpp
Normal file
16
FifoQueue.hpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
class FifoQueue{
|
||||||
|
private:
|
||||||
|
std::mutex qMutex;
|
||||||
|
public:
|
||||||
|
std::queue<int> FifoQueue;
|
||||||
|
|
||||||
|
bool empty();
|
||||||
|
void pop();
|
||||||
|
void push(int i);
|
||||||
|
unsigned int front();
|
||||||
|
};
|
||||||
208
Makefile
Normal file
208
Makefile
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
|
||||||
|
|
||||||
|
# Default target executed when no arguments are given to make.
|
||||||
|
default_target: all
|
||||||
|
|
||||||
|
.PHONY : default_target
|
||||||
|
|
||||||
|
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||||
|
.NOTPARALLEL:
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Special targets provided by cmake.
|
||||||
|
|
||||||
|
# Disable implicit rules so canonical targets will work.
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
|
||||||
|
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||||
|
SUFFIXES =
|
||||||
|
|
||||||
|
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||||
|
|
||||||
|
|
||||||
|
# Suppress display of executed commands.
|
||||||
|
$(VERBOSE).SILENT:
|
||||||
|
|
||||||
|
|
||||||
|
# A target that is always out of date.
|
||||||
|
cmake_force:
|
||||||
|
|
||||||
|
.PHONY : cmake_force
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Set environment variables for the build.
|
||||||
|
|
||||||
|
# The shell in which to execute make rules.
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
# The CMake executable.
|
||||||
|
CMAKE_COMMAND = /usr/bin/cmake
|
||||||
|
|
||||||
|
# The command to remove a file.
|
||||||
|
RM = /usr/bin/cmake -E remove -f
|
||||||
|
|
||||||
|
# Escaping for special characters.
|
||||||
|
EQUALS = =
|
||||||
|
|
||||||
|
# The top-level source directory on which CMake was run.
|
||||||
|
CMAKE_SOURCE_DIR = /home/pi/Repos/cs3100hw5
|
||||||
|
|
||||||
|
# The top-level build directory on which CMake was run.
|
||||||
|
CMAKE_BINARY_DIR = /home/pi/Repos/cs3100hw5
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Targets provided globally by CMake.
|
||||||
|
|
||||||
|
# Special rule for the target rebuild_cache
|
||||||
|
rebuild_cache:
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||||
|
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||||
|
.PHONY : rebuild_cache
|
||||||
|
|
||||||
|
# Special rule for the target rebuild_cache
|
||||||
|
rebuild_cache/fast: rebuild_cache
|
||||||
|
|
||||||
|
.PHONY : rebuild_cache/fast
|
||||||
|
|
||||||
|
# Special rule for the target edit_cache
|
||||||
|
edit_cache:
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
|
||||||
|
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
|
||||||
|
.PHONY : edit_cache
|
||||||
|
|
||||||
|
# Special rule for the target edit_cache
|
||||||
|
edit_cache/fast: edit_cache
|
||||||
|
|
||||||
|
.PHONY : edit_cache/fast
|
||||||
|
|
||||||
|
# The main all target
|
||||||
|
all: cmake_check_build_system
|
||||||
|
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/CMakeFiles /home/pi/Repos/cs3100hw5/CMakeFiles/progress.marks
|
||||||
|
$(MAKE) -f CMakeFiles/Makefile2 all
|
||||||
|
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/CMakeFiles 0
|
||||||
|
.PHONY : all
|
||||||
|
|
||||||
|
# The main clean target
|
||||||
|
clean:
|
||||||
|
$(MAKE) -f CMakeFiles/Makefile2 clean
|
||||||
|
.PHONY : clean
|
||||||
|
|
||||||
|
# The main clean target
|
||||||
|
clean/fast: clean
|
||||||
|
|
||||||
|
.PHONY : clean/fast
|
||||||
|
|
||||||
|
# Prepare targets for installation.
|
||||||
|
preinstall: all
|
||||||
|
$(MAKE) -f CMakeFiles/Makefile2 preinstall
|
||||||
|
.PHONY : preinstall
|
||||||
|
|
||||||
|
# Prepare targets for installation.
|
||||||
|
preinstall/fast:
|
||||||
|
$(MAKE) -f CMakeFiles/Makefile2 preinstall
|
||||||
|
.PHONY : preinstall/fast
|
||||||
|
|
||||||
|
# clear depends
|
||||||
|
depend:
|
||||||
|
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||||
|
.PHONY : depend
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Target rules for targets named ComputePi
|
||||||
|
|
||||||
|
# Build rule for target.
|
||||||
|
ComputePi: cmake_check_build_system
|
||||||
|
$(MAKE) -f CMakeFiles/Makefile2 ComputePi
|
||||||
|
.PHONY : ComputePi
|
||||||
|
|
||||||
|
# fast build rule for target.
|
||||||
|
ComputePi/fast:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/build
|
||||||
|
.PHONY : ComputePi/fast
|
||||||
|
|
||||||
|
computePi.o: computePi.cpp.o
|
||||||
|
|
||||||
|
.PHONY : computePi.o
|
||||||
|
|
||||||
|
# target to build an object file
|
||||||
|
computePi.cpp.o:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/computePi.cpp.o
|
||||||
|
.PHONY : computePi.cpp.o
|
||||||
|
|
||||||
|
computePi.i: computePi.cpp.i
|
||||||
|
|
||||||
|
.PHONY : computePi.i
|
||||||
|
|
||||||
|
# target to preprocess a source file
|
||||||
|
computePi.cpp.i:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/computePi.cpp.i
|
||||||
|
.PHONY : computePi.cpp.i
|
||||||
|
|
||||||
|
computePi.s: computePi.cpp.s
|
||||||
|
|
||||||
|
.PHONY : computePi.s
|
||||||
|
|
||||||
|
# target to generate assembly for a file
|
||||||
|
computePi.cpp.s:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/computePi.cpp.s
|
||||||
|
.PHONY : computePi.cpp.s
|
||||||
|
|
||||||
|
main.o: main.cpp.o
|
||||||
|
|
||||||
|
.PHONY : main.o
|
||||||
|
|
||||||
|
# target to build an object file
|
||||||
|
main.cpp.o:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/main.cpp.o
|
||||||
|
.PHONY : main.cpp.o
|
||||||
|
|
||||||
|
main.i: main.cpp.i
|
||||||
|
|
||||||
|
.PHONY : main.i
|
||||||
|
|
||||||
|
# target to preprocess a source file
|
||||||
|
main.cpp.i:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/main.cpp.i
|
||||||
|
.PHONY : main.cpp.i
|
||||||
|
|
||||||
|
main.s: main.cpp.s
|
||||||
|
|
||||||
|
.PHONY : main.s
|
||||||
|
|
||||||
|
# target to generate assembly for a file
|
||||||
|
main.cpp.s:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/main.cpp.s
|
||||||
|
.PHONY : main.cpp.s
|
||||||
|
|
||||||
|
# Help Target
|
||||||
|
help:
|
||||||
|
@echo "The following are some of the valid targets for this Makefile:"
|
||||||
|
@echo "... all (the default if no target is provided)"
|
||||||
|
@echo "... clean"
|
||||||
|
@echo "... depend"
|
||||||
|
@echo "... rebuild_cache"
|
||||||
|
@echo "... edit_cache"
|
||||||
|
@echo "... ComputePi"
|
||||||
|
@echo "... computePi.o"
|
||||||
|
@echo "... computePi.i"
|
||||||
|
@echo "... computePi.s"
|
||||||
|
@echo "... main.o"
|
||||||
|
@echo "... main.i"
|
||||||
|
@echo "... main.s"
|
||||||
|
.PHONY : help
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Special targets to cleanup operation of make.
|
||||||
|
|
||||||
|
# Special rule to run CMake to check the build system integrity.
|
||||||
|
# No rule that depends on this can have commands that come from listfiles
|
||||||
|
# because they might be regenerated.
|
||||||
|
cmake_check_build_system:
|
||||||
|
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||||
|
.PHONY : cmake_check_build_system
|
||||||
|
|
||||||
11
Map.cpp
Normal file
11
Map.cpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include "Map.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
void Map::safeInsert(int key, unsigned int value){
|
||||||
|
std::lock_guard<std::mutex> lock(qMutex);
|
||||||
|
uMap.insert({key, value});
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int Map::find(int key){
|
||||||
|
return uMap[key];
|
||||||
|
}
|
||||||
13
Map.hpp
Normal file
13
Map.hpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
class Map{
|
||||||
|
private:
|
||||||
|
std::mutex qMutex;
|
||||||
|
public:
|
||||||
|
std::unordered_map<int, unsigned int> uMap;
|
||||||
|
void safeInsert(int key, unsigned int value);
|
||||||
|
unsigned int find(int key);
|
||||||
|
};
|
||||||
@@ -6,6 +6,26 @@
|
|||||||
|
|
||||||
#IncludeRegexTransform:
|
#IncludeRegexTransform:
|
||||||
|
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.cpp
|
||||||
|
FifoQueue.hpp
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.hpp
|
||||||
|
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.hpp
|
||||||
|
queue
|
||||||
|
-
|
||||||
|
mutex
|
||||||
|
-
|
||||||
|
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.cpp
|
||||||
|
Map.hpp
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.hpp
|
||||||
|
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.hpp
|
||||||
|
unordered_map
|
||||||
|
-
|
||||||
|
mutex
|
||||||
|
-
|
||||||
|
|
||||||
/home/pi/Repos/cs3100hw5/computePi.cpp
|
/home/pi/Repos/cs3100hw5/computePi.cpp
|
||||||
computePi.hpp
|
computePi.hpp
|
||||||
/home/pi/Repos/cs3100hw5/computePi.hpp
|
/home/pi/Repos/cs3100hw5/computePi.hpp
|
||||||
@@ -27,6 +47,10 @@ vector
|
|||||||
-
|
-
|
||||||
memory
|
memory
|
||||||
-
|
-
|
||||||
|
FifoQueue.hpp
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.hpp
|
||||||
|
Map.hpp
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.hpp
|
||||||
computePi.hpp
|
computePi.hpp
|
||||||
/home/pi/Repos/cs3100hw5/computePi.hpp
|
/home/pi/Repos/cs3100hw5/computePi.hpp
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ set(CMAKE_DEPENDS_LANGUAGES
|
|||||||
)
|
)
|
||||||
# The set of files for implicit dependencies of each language:
|
# The set of files for implicit dependencies of each language:
|
||||||
set(CMAKE_DEPENDS_CHECK_CXX
|
set(CMAKE_DEPENDS_CHECK_CXX
|
||||||
|
"/home/pi/Repos/cs3100hw5/FifoQueue.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/FifoQueue.cpp.o"
|
||||||
|
"/home/pi/Repos/cs3100hw5/Map.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/Map.cpp.o"
|
||||||
"/home/pi/Repos/cs3100hw5/computePi.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/computePi.cpp.o"
|
"/home/pi/Repos/cs3100hw5/computePi.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/computePi.cpp.o"
|
||||||
"/home/pi/Repos/cs3100hw5/main.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/main.cpp.o"
|
"/home/pi/Repos/cs3100hw5/main.cpp" "/home/pi/Repos/cs3100hw5/build/CMakeFiles/ComputePi.dir/main.cpp.o"
|
||||||
)
|
)
|
||||||
|
|||||||
BIN
build/CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
Normal file
BIN
build/CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
Normal file
Binary file not shown.
BIN
build/CMakeFiles/ComputePi.dir/Map.cpp.o
Normal file
BIN
build/CMakeFiles/ComputePi.dir/Map.cpp.o
Normal file
Binary file not shown.
@@ -105,19 +105,71 @@ CMakeFiles/ComputePi.dir/computePi.cpp.o.provides: CMakeFiles/ComputePi.dir/comp
|
|||||||
CMakeFiles/ComputePi.dir/computePi.cpp.o.provides.build: CMakeFiles/ComputePi.dir/computePi.cpp.o
|
CMakeFiles/ComputePi.dir/computePi.cpp.o.provides.build: CMakeFiles/ComputePi.dir/computePi.cpp.o
|
||||||
|
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o: CMakeFiles/ComputePi.dir/flags.make
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o: ../Map.cpp
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/ComputePi.dir/Map.cpp.o"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/ComputePi.dir/Map.cpp.o -c /home/pi/Repos/cs3100hw5/Map.cpp
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.i: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/ComputePi.dir/Map.cpp.i"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/pi/Repos/cs3100hw5/Map.cpp > CMakeFiles/ComputePi.dir/Map.cpp.i
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.s: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/ComputePi.dir/Map.cpp.s"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/pi/Repos/cs3100hw5/Map.cpp -o CMakeFiles/ComputePi.dir/Map.cpp.s
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o.requires:
|
||||||
|
|
||||||
|
.PHONY : CMakeFiles/ComputePi.dir/Map.cpp.o.requires
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o.provides: CMakeFiles/ComputePi.dir/Map.cpp.o.requires
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/Map.cpp.o.provides.build
|
||||||
|
.PHONY : CMakeFiles/ComputePi.dir/Map.cpp.o.provides
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o.provides.build: CMakeFiles/ComputePi.dir/Map.cpp.o
|
||||||
|
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o: CMakeFiles/ComputePi.dir/flags.make
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o: ../FifoQueue.cpp
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/ComputePi.dir/FifoQueue.cpp.o"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/ComputePi.dir/FifoQueue.cpp.o -c /home/pi/Repos/cs3100hw5/FifoQueue.cpp
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.i: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/ComputePi.dir/FifoQueue.cpp.i"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/pi/Repos/cs3100hw5/FifoQueue.cpp > CMakeFiles/ComputePi.dir/FifoQueue.cpp.i
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.s: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/ComputePi.dir/FifoQueue.cpp.s"
|
||||||
|
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/pi/Repos/cs3100hw5/FifoQueue.cpp -o CMakeFiles/ComputePi.dir/FifoQueue.cpp.s
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.requires:
|
||||||
|
|
||||||
|
.PHONY : CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.requires
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.provides: CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.requires
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.provides.build
|
||||||
|
.PHONY : CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.provides
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.provides.build: CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
|
||||||
|
|
||||||
|
|
||||||
# Object files for target ComputePi
|
# Object files for target ComputePi
|
||||||
ComputePi_OBJECTS = \
|
ComputePi_OBJECTS = \
|
||||||
"CMakeFiles/ComputePi.dir/main.cpp.o" \
|
"CMakeFiles/ComputePi.dir/main.cpp.o" \
|
||||||
"CMakeFiles/ComputePi.dir/computePi.cpp.o"
|
"CMakeFiles/ComputePi.dir/computePi.cpp.o" \
|
||||||
|
"CMakeFiles/ComputePi.dir/Map.cpp.o" \
|
||||||
|
"CMakeFiles/ComputePi.dir/FifoQueue.cpp.o"
|
||||||
|
|
||||||
# External object files for target ComputePi
|
# External object files for target ComputePi
|
||||||
ComputePi_EXTERNAL_OBJECTS =
|
ComputePi_EXTERNAL_OBJECTS =
|
||||||
|
|
||||||
ComputePi: CMakeFiles/ComputePi.dir/main.cpp.o
|
ComputePi: CMakeFiles/ComputePi.dir/main.cpp.o
|
||||||
ComputePi: CMakeFiles/ComputePi.dir/computePi.cpp.o
|
ComputePi: CMakeFiles/ComputePi.dir/computePi.cpp.o
|
||||||
|
ComputePi: CMakeFiles/ComputePi.dir/Map.cpp.o
|
||||||
|
ComputePi: CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
|
||||||
ComputePi: CMakeFiles/ComputePi.dir/build.make
|
ComputePi: CMakeFiles/ComputePi.dir/build.make
|
||||||
ComputePi: CMakeFiles/ComputePi.dir/link.txt
|
ComputePi: CMakeFiles/ComputePi.dir/link.txt
|
||||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Linking CXX executable ComputePi"
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Linking CXX executable ComputePi"
|
||||||
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/ComputePi.dir/link.txt --verbose=$(VERBOSE)
|
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/ComputePi.dir/link.txt --verbose=$(VERBOSE)
|
||||||
|
|
||||||
# Rule to build all files generated by this target.
|
# Rule to build all files generated by this target.
|
||||||
@@ -127,6 +179,8 @@ CMakeFiles/ComputePi.dir/build: ComputePi
|
|||||||
|
|
||||||
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/main.cpp.o.requires
|
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/main.cpp.o.requires
|
||||||
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/computePi.cpp.o.requires
|
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/computePi.cpp.o.requires
|
||||||
|
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/Map.cpp.o.requires
|
||||||
|
CMakeFiles/ComputePi.dir/requires: CMakeFiles/ComputePi.dir/FifoQueue.cpp.o.requires
|
||||||
|
|
||||||
.PHONY : CMakeFiles/ComputePi.dir/requires
|
.PHONY : CMakeFiles/ComputePi.dir/requires
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
file(REMOVE_RECURSE
|
file(REMOVE_RECURSE
|
||||||
"CMakeFiles/ComputePi.dir/main.cpp.o"
|
"CMakeFiles/ComputePi.dir/main.cpp.o"
|
||||||
"CMakeFiles/ComputePi.dir/computePi.cpp.o"
|
"CMakeFiles/ComputePi.dir/computePi.cpp.o"
|
||||||
|
"CMakeFiles/ComputePi.dir/Map.cpp.o"
|
||||||
|
"CMakeFiles/ComputePi.dir/FifoQueue.cpp.o"
|
||||||
"ComputePi.pdb"
|
"ComputePi.pdb"
|
||||||
"ComputePi"
|
"ComputePi"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
# CMAKE generated file: DO NOT EDIT!
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.cpp
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.hpp
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.cpp
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.hpp
|
||||||
CMakeFiles/ComputePi.dir/computePi.cpp.o
|
CMakeFiles/ComputePi.dir/computePi.cpp.o
|
||||||
/home/pi/Repos/cs3100hw5/computePi.cpp
|
/home/pi/Repos/cs3100hw5/computePi.cpp
|
||||||
/home/pi/Repos/cs3100hw5/computePi.hpp
|
/home/pi/Repos/cs3100hw5/computePi.hpp
|
||||||
CMakeFiles/ComputePi.dir/main.cpp.o
|
CMakeFiles/ComputePi.dir/main.cpp.o
|
||||||
|
/home/pi/Repos/cs3100hw5/FifoQueue.hpp
|
||||||
|
/home/pi/Repos/cs3100hw5/Map.hpp
|
||||||
/home/pi/Repos/cs3100hw5/computePi.hpp
|
/home/pi/Repos/cs3100hw5/computePi.hpp
|
||||||
/home/pi/Repos/cs3100hw5/main.cpp
|
/home/pi/Repos/cs3100hw5/main.cpp
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
# CMAKE generated file: DO NOT EDIT!
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o: ../FifoQueue.cpp
|
||||||
|
CMakeFiles/ComputePi.dir/FifoQueue.cpp.o: ../FifoQueue.hpp
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o: ../Map.cpp
|
||||||
|
CMakeFiles/ComputePi.dir/Map.cpp.o: ../Map.hpp
|
||||||
|
|
||||||
CMakeFiles/ComputePi.dir/computePi.cpp.o: ../computePi.cpp
|
CMakeFiles/ComputePi.dir/computePi.cpp.o: ../computePi.cpp
|
||||||
CMakeFiles/ComputePi.dir/computePi.cpp.o: ../computePi.hpp
|
CMakeFiles/ComputePi.dir/computePi.cpp.o: ../computePi.hpp
|
||||||
|
|
||||||
|
CMakeFiles/ComputePi.dir/main.cpp.o: ../FifoQueue.hpp
|
||||||
|
CMakeFiles/ComputePi.dir/main.cpp.o: ../Map.hpp
|
||||||
CMakeFiles/ComputePi.dir/main.cpp.o: ../computePi.hpp
|
CMakeFiles/ComputePi.dir/main.cpp.o: ../computePi.hpp
|
||||||
CMakeFiles/ComputePi.dir/main.cpp.o: ../main.cpp
|
CMakeFiles/ComputePi.dir/main.cpp.o: ../main.cpp
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
/usr/bin/c++ -std=c++11 -pthread -O3 CMakeFiles/ComputePi.dir/main.cpp.o CMakeFiles/ComputePi.dir/computePi.cpp.o -o ComputePi -rdynamic
|
/usr/bin/c++ -std=c++11 -pthread -O3 CMakeFiles/ComputePi.dir/main.cpp.o CMakeFiles/ComputePi.dir/computePi.cpp.o CMakeFiles/ComputePi.dir/Map.cpp.o CMakeFiles/ComputePi.dir/FifoQueue.cpp.o -o ComputePi -rdynamic
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,6 @@
|
|||||||
CMAKE_PROGRESS_1 = 1
|
CMAKE_PROGRESS_1 = 1
|
||||||
CMAKE_PROGRESS_2 = 2
|
CMAKE_PROGRESS_2 = 2
|
||||||
CMAKE_PROGRESS_3 = 3
|
CMAKE_PROGRESS_3 = 3
|
||||||
|
CMAKE_PROGRESS_4 = 4
|
||||||
|
CMAKE_PROGRESS_5 = 5
|
||||||
|
|
||||||
|
|||||||
@@ -11,81 +11,16 @@ set(CMAKE_MAKEFILE_DEPENDS
|
|||||||
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
|
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
|
||||||
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
|
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
|
||||||
"CMakeFiles/3.7.2/CMakeSystem.cmake"
|
"CMakeFiles/3.7.2/CMakeSystem.cmake"
|
||||||
"CMakeFiles/feature_tests.c"
|
|
||||||
"CMakeFiles/feature_tests.cxx"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCCompiler.cmake.in"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCInformation.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeCInformation.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCXXCompiler.cmake.in"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCXXCompilerABI.cpp"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCXXInformation.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeCXXInformation.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCommonLanguageInclude.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeCommonLanguageInclude.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeCompilerIdDetection.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCXXCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompileFeatures.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompilerABI.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompilerId.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeDetermineSystem.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeFindBinUtils.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeGenericSystem.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeGenericSystem.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeLanguageInformation.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeLanguageInformation.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeParseArguments.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeParseImplicitLinkInfo.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeSystem.cmake.in"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInitialize.cmake"
|
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInitialize.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeTestCompilerCommon.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/CMakeUnixFindMake.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/ADSP-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Borland-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Cray-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GHS-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C-FeatureTests.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C.cmake"
|
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU-CXX-FeatureTests.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU-CXX.cmake"
|
"/usr/share/cmake-3.7/Modules/Compiler/GNU-CXX.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/GNU.cmake"
|
"/usr/share/cmake-3.7/Modules/Compiler/GNU.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/HP-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/IAR-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Intel-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/MSVC-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/PGI-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/PathScale-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/SCO-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/TI-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/Watcom-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/XL-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Internal/FeatureTesting.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Platform/Linux-Determine-CXX.cmake"
|
|
||||||
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-C.cmake"
|
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-C.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-CXX.cmake"
|
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-CXX.cmake"
|
||||||
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU.cmake"
|
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU.cmake"
|
||||||
@@ -101,11 +36,6 @@ set(CMAKE_MAKEFILE_OUTPUTS
|
|||||||
|
|
||||||
# Byproducts of CMake generate step:
|
# Byproducts of CMake generate step:
|
||||||
set(CMAKE_MAKEFILE_PRODUCTS
|
set(CMAKE_MAKEFILE_PRODUCTS
|
||||||
"CMakeFiles/3.7.2/CMakeSystem.cmake"
|
|
||||||
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
|
|
||||||
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
|
|
||||||
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
|
|
||||||
"CMakeFiles/3.7.2/CMakeCXXCompiler.cmake"
|
|
||||||
"CMakeFiles/CMakeDirectoryInformation.cmake"
|
"CMakeFiles/CMakeDirectoryInformation.cmake"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ CMAKE_BINARY_DIR = /home/pi/Repos/cs3100hw5/build
|
|||||||
CMakeFiles/ComputePi.dir/all:
|
CMakeFiles/ComputePi.dir/all:
|
||||||
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/depend
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/depend
|
||||||
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/build
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/build
|
||||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=1,2,3 "Built target ComputePi"
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/pi/Repos/cs3100hw5/build/CMakeFiles --progress-num=1,2,3,4,5 "Built target ComputePi"
|
||||||
.PHONY : CMakeFiles/ComputePi.dir/all
|
.PHONY : CMakeFiles/ComputePi.dir/all
|
||||||
|
|
||||||
# Include target in all.
|
# Include target in all.
|
||||||
@@ -76,7 +76,7 @@ all: CMakeFiles/ComputePi.dir/all
|
|||||||
|
|
||||||
# Build rule for subdir invocation for target.
|
# Build rule for subdir invocation for target.
|
||||||
CMakeFiles/ComputePi.dir/rule: cmake_check_build_system
|
CMakeFiles/ComputePi.dir/rule: cmake_check_build_system
|
||||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/build/CMakeFiles 3
|
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/build/CMakeFiles 5
|
||||||
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/ComputePi.dir/all
|
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/ComputePi.dir/all
|
||||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/build/CMakeFiles 0
|
$(CMAKE_COMMAND) -E cmake_progress_start /home/pi/Repos/cs3100hw5/build/CMakeFiles 0
|
||||||
.PHONY : CMakeFiles/ComputePi.dir/rule
|
.PHONY : CMakeFiles/ComputePi.dir/rule
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3
|
5
|
||||||
|
|||||||
BIN
build/ComputePi
BIN
build/ComputePi
Binary file not shown.
@@ -123,6 +123,60 @@ ComputePi/fast:
|
|||||||
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/build
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/build
|
||||||
.PHONY : ComputePi/fast
|
.PHONY : ComputePi/fast
|
||||||
|
|
||||||
|
FifoQueue.o: FifoQueue.cpp.o
|
||||||
|
|
||||||
|
.PHONY : FifoQueue.o
|
||||||
|
|
||||||
|
# target to build an object file
|
||||||
|
FifoQueue.cpp.o:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/FifoQueue.cpp.o
|
||||||
|
.PHONY : FifoQueue.cpp.o
|
||||||
|
|
||||||
|
FifoQueue.i: FifoQueue.cpp.i
|
||||||
|
|
||||||
|
.PHONY : FifoQueue.i
|
||||||
|
|
||||||
|
# target to preprocess a source file
|
||||||
|
FifoQueue.cpp.i:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/FifoQueue.cpp.i
|
||||||
|
.PHONY : FifoQueue.cpp.i
|
||||||
|
|
||||||
|
FifoQueue.s: FifoQueue.cpp.s
|
||||||
|
|
||||||
|
.PHONY : FifoQueue.s
|
||||||
|
|
||||||
|
# target to generate assembly for a file
|
||||||
|
FifoQueue.cpp.s:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/FifoQueue.cpp.s
|
||||||
|
.PHONY : FifoQueue.cpp.s
|
||||||
|
|
||||||
|
Map.o: Map.cpp.o
|
||||||
|
|
||||||
|
.PHONY : Map.o
|
||||||
|
|
||||||
|
# target to build an object file
|
||||||
|
Map.cpp.o:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/Map.cpp.o
|
||||||
|
.PHONY : Map.cpp.o
|
||||||
|
|
||||||
|
Map.i: Map.cpp.i
|
||||||
|
|
||||||
|
.PHONY : Map.i
|
||||||
|
|
||||||
|
# target to preprocess a source file
|
||||||
|
Map.cpp.i:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/Map.cpp.i
|
||||||
|
.PHONY : Map.cpp.i
|
||||||
|
|
||||||
|
Map.s: Map.cpp.s
|
||||||
|
|
||||||
|
.PHONY : Map.s
|
||||||
|
|
||||||
|
# target to generate assembly for a file
|
||||||
|
Map.cpp.s:
|
||||||
|
$(MAKE) -f CMakeFiles/ComputePi.dir/build.make CMakeFiles/ComputePi.dir/Map.cpp.s
|
||||||
|
.PHONY : Map.cpp.s
|
||||||
|
|
||||||
computePi.o: computePi.cpp.o
|
computePi.o: computePi.cpp.o
|
||||||
|
|
||||||
.PHONY : computePi.o
|
.PHONY : computePi.o
|
||||||
@@ -186,6 +240,12 @@ help:
|
|||||||
@echo "... rebuild_cache"
|
@echo "... rebuild_cache"
|
||||||
@echo "... edit_cache"
|
@echo "... edit_cache"
|
||||||
@echo "... ComputePi"
|
@echo "... ComputePi"
|
||||||
|
@echo "... FifoQueue.o"
|
||||||
|
@echo "... FifoQueue.i"
|
||||||
|
@echo "... FifoQueue.s"
|
||||||
|
@echo "... Map.o"
|
||||||
|
@echo "... Map.i"
|
||||||
|
@echo "... Map.s"
|
||||||
@echo "... computePi.o"
|
@echo "... computePi.o"
|
||||||
@echo "... computePi.i"
|
@echo "... computePi.i"
|
||||||
@echo "... computePi.s"
|
@echo "... computePi.s"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
* your compiler supports 'long long' integers of 64 bits, you may use
|
* your compiler supports 'long long' integers of 64 bits, you may use
|
||||||
* the integer version of 'mul_mod' (see HAS_LONG_LONG).
|
* the integer version of 'mul_mod' (see HAS_LONG_LONG).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "computePi.hpp"
|
#include "computePi.hpp"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|||||||
41
main.cpp
41
main.cpp
@@ -3,30 +3,32 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "FifoQueue.hpp"
|
||||||
|
#include "Map.hpp"
|
||||||
#include "computePi.hpp"
|
#include "computePi.hpp"
|
||||||
|
|
||||||
|
|
||||||
void threadWorker(std::uint16_t threadNum) {
|
void threadWorker(std::uint16_t threadNum, FifoQueue* threadSafeQueue, Map* threadSafeMap) {
|
||||||
#warning TODO: This function will take a reference to the FIFO task queue as an argument
|
while(!threadSafeQueue->empty()){
|
||||||
#warning TODO: This function will take a reference to your unordered_map as an argument
|
int index = threadSafeQueue->front();
|
||||||
|
threadSafeQueue->pop();
|
||||||
|
unsigned int piDigit = computePiDigit(index);
|
||||||
|
threadSafeMap->safeInsert(index, piDigit);
|
||||||
|
std::cout << ".";
|
||||||
|
std::cout.flush();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// This code exists simply to illustrate a worker thread.
|
|
||||||
// I had better not see this in your final submission.
|
|
||||||
std::cout << "Hi! I'm thread number " << threadNum << ", and I can count to 10!\n";
|
|
||||||
for (int i = 1; i <= 10; ++i)
|
|
||||||
std::cout << "[" << threadNum << "] " << i << std::endl;
|
|
||||||
|
|
||||||
std::cout << "[" << threadNum << "] watch me compute digit #"
|
|
||||||
<< threadNum+1 << " of pi: "
|
|
||||||
<< computePiDigit(threadNum+1) << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
#warning TODO: Initialize your thread-safe data structures here
|
FifoQueue* threadSafeQueue = new FifoQueue();
|
||||||
|
Map* threadSafeMap = new Map();
|
||||||
|
for(int i = 1; i <= 1000; i++){
|
||||||
|
threadSafeQueue->push(i);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// Make as many threads as there are CPU cores
|
// Make as many threads as there are CPU cores
|
||||||
// Assign them to run our threadWorker function, and supply arguments as necessary for that function
|
// Assign them to run our threadWorker function, and supply arguments as necessary for that function
|
||||||
@@ -34,16 +36,17 @@ int main() {
|
|||||||
for (std::uint16_t core = 0; core < std::thread::hardware_concurrency(); core++)
|
for (std::uint16_t core = 0; core < std::thread::hardware_concurrency(); core++)
|
||||||
// The arguments you wish to pass to threadWorker are passed as
|
// The arguments you wish to pass to threadWorker are passed as
|
||||||
// arguments to the constructor of std::thread
|
// arguments to the constructor of std::thread
|
||||||
threads.push_back(std::make_shared<std::thread>(threadWorker, core));
|
threads.push_back(std::make_shared<std::thread>(threadWorker, core, threadSafeQueue, threadSafeMap));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Wait for all of these threads to complete
|
// Wait for all of these threads to complete
|
||||||
for (auto&& thread : threads)
|
for (auto&& thread : threads)
|
||||||
thread->join();
|
thread->join();
|
||||||
|
|
||||||
std::cout << std::endl << std::endl;
|
std::cout << std::endl << std::endl << "3.";
|
||||||
|
|
||||||
#warning TODO: Print the digits of PI from our unordered_map, in order
|
|
||||||
|
|
||||||
|
for(int i = 1; i <= 1000; i++){
|
||||||
|
std::cout << threadSafeMap->find(i);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user