From 3bfa177dcf135edb4e00d824ab690ce9ca352c7c Mon Sep 17 00:00:00 2001 From: Ayoub Boughourfi <ayoub.boughourfi@et.hs-fulda.de> Date: Tue, 11 Mar 2025 23:53:47 +0100 Subject: [PATCH] Upload New File --- pthwithcuda/cuda/alt_cuda.cuh | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pthwithcuda/cuda/alt_cuda.cuh diff --git a/pthwithcuda/cuda/alt_cuda.cuh b/pthwithcuda/cuda/alt_cuda.cuh new file mode 100644 index 0000000..8c167cd --- /dev/null +++ b/pthwithcuda/cuda/alt_cuda.cuh @@ -0,0 +1,37 @@ +#ifndef ALT_CUDA_CUH +#define ALT_CUDA_CUH + +#include <vector> +#include <queue> +#include <limits> +#include <random> +#include <algorithm> +#include "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include/cuda_runtime.h" + +class ALTCUDA { +public: + // Struktur für Landmark-Distanzen + struct LandmarkDistances { + std::vector<std::vector<double>> distancesFromLandmark; + std::vector<std::vector<double>> distancesToLandmark; + }; + + ALTCUDA() {} + + // Dijkstra-Hilfsfunktion mit CUDA + std::vector<double> dijkstra_cuda(const std::vector<std::vector<double>>& graph, int src); + + // Landmark-Distanzen berechnen + LandmarkDistances computeLandmarkDistances( + const std::vector<std::vector<double>>& graph, + const std::vector<int>& landmarks); + + // ALT-Hauptalgorithmus mit CUDA + std::vector<double> run( + const std::vector<std::vector<double>>& graph, + int start, + int goal, + int numLandmarks = 5); +}; + +#endif // ALT_CUDA_CUH -- GitLab