Skip to content

Commit

Permalink
forgot to add menu.h, added files in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdot42 committed Jul 4, 2014
1 parent 3750248 commit b3087dc
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CSRC = sieve.c timer.c parse.c read_config.c mfaktc.c checkpoint.c \
signal_handler.c filelocking.c output.c
CLSRC = barrett15.cl barrett24.cl barrett.cl common.cl gpusieve.cl mfakto_Kernels.cl montgomery.cl mul24.cl

COBJS = $(CSRC:.c=.o) mfakto.o gpusieve.o perftest.o
COBJS = $(CSRC:.c=.o) mfakto.o gpusieve.o perftest.o menu.o kbhit.o

##############################################################################

Expand Down
29 changes: 25 additions & 4 deletions src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ static void handle_menu(mystuff_t *mystuff)
mystuff->quit++;
break;
}
if (choice == 0) break; // continue

if (choice == 0)
{
if (mystuff->verbosity > 0) printf("\nContinuing\n");
break; // continue
}
std::cout << "Change setting number " << choice << " to:";
std::cin >> new_value_string;
new_value = atoi(new_value_string);
Expand Down Expand Up @@ -188,10 +191,12 @@ static void increase_sieve_process_size(mystuff_t *mystuff)

static void use_previous_kernel(mystuff_t *mystuff)
{
printf("prev kernel: not yet implemented\n");
}

static void use_next_kernel(mystuff_t *mystuff)
{
printf("next kernel: not yet implemented\n");
}

int handle_kb_input(mystuff_t *mystuff)
Expand All @@ -205,16 +210,32 @@ int handle_kb_input(mystuff_t *mystuff)
case 'm': handle_menu(mystuff);
break;
case '-': lower_sieve_primes(mystuff);
if (mystuff->verbosity > 0)
printf("\nDecrease %sSievePrimes to %u\n", mystuff->gpu_sieving?"GPU":"",
mystuff->gpu_sieving?mystuff->gpu_sieve_primes:mystuff->sieve_primes);
break;
case '+': increase_sieve_primes(mystuff);
if (mystuff->verbosity > 0)
printf("\nIncrease %sSievePrimes to %u\n", mystuff->gpu_sieving?"GPU":"",
mystuff->gpu_sieving?mystuff->gpu_sieve_primes:mystuff->sieve_primes);
break;
case 's': lower_sieve_size(mystuff);
if (mystuff->verbosity > 0)
printf("\nDecrease %sSieveSize to %u\n", mystuff->gpu_sieving?"GPU":"",
mystuff->gpu_sieving?mystuff->gpu_sieve_size:mystuff->sieve_size);
break;
case 'S': increase_sieve_size(mystuff);
if (mystuff->verbosity > 0)
printf("\nIncrease %sSieveSize to %u\n", mystuff->gpu_sieving?"GPU":"",
mystuff->gpu_sieving?mystuff->gpu_sieve_size:mystuff->sieve_size);
break;
case 'p': lower_sieve_process_size(mystuff);
if ((mystuff->verbosity > 0) && mystuff->gpu_sieving)
printf("\nDecrease GPUSieveProcessSize to %u\n", mystuff->gpu_sieve_processing_size);
break;
case 'P': increase_sieve_process_size(mystuff);
if ((mystuff->verbosity > 0) && mystuff->gpu_sieving)
printf("\nIncrease GPUSieveProcessSize to %u\n", mystuff->gpu_sieve_processing_size);
break;
case 'a': if (mystuff->verbosity > 0)
printf("\nSetting SievePrimesAdjust to 0 (was %u)\n", mystuff->sieve_primes_adjust);
Expand All @@ -238,11 +259,11 @@ int handle_kb_input(mystuff_t *mystuff)
case 'v': if (mystuff->verbosity > 0)
{
mystuff->verbosity--;
printf("\nSetting Verbosity to %u\n", mystuff->verbosity);
printf("\nDecrease Verbosity to %u\n", mystuff->verbosity);
}
break;
case 'V': mystuff->verbosity++;
if (mystuff->verbosity > 0) printf("\nSetting Verbosity to %u\n", mystuff->verbosity);
if (mystuff->verbosity > 0) printf("\nIncrease Verbosity to %u\n", mystuff->verbosity);
break;
case 'r': if (mystuff->verbosity > 0)
printf("\nSetting PrintMode to 0 (was %u)\n", mystuff->printmode);
Expand Down
28 changes: 28 additions & 0 deletions src/menu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
This file is part of mfaktc (mfakto).
Copyright (C) 2014 Oliver Weihe ([email protected])
Bertram Franz ([email protected])
mfaktc (mfakto) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mfaktc (mfakto) is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mfaktc (mfakto). If not, see <http://www.gnu.org/licenses/>.
*/

/* code to handle dynamic changing of settings */

#ifndef menu_H_
#define menu_H_

#include "my_types.h"
int handle_kb_input(mystuff_t *mystuff);

#endif

0 comments on commit b3087dc

Please sign in to comment.