mirror of
https://github.com/andreinechaev/nvcc4jupyter.git
synced 2026-06-13 18:50:47 +05:30
Remove help from parser arguments and instead provide links in the parser description to documentation to avoid duplicate text
This commit is contained in:
+18
-73
@@ -5,53 +5,25 @@ def get_parser_cuda() -> argparse.ArgumentParser:
|
|||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=(
|
description=(
|
||||||
"%%cuda magic that compiles and runs CUDA C++ code in this cell."
|
"%%cuda magic that compiles and runs CUDA C++ code in this cell."
|
||||||
|
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda"
|
||||||
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument("-t", "--timeit", action="store_true")
|
||||||
"-t",
|
parser.add_argument("-p", "--profile", action="store_true")
|
||||||
"--timeit",
|
parser.add_argument("-a", "--profiler-args", type=str, default="")
|
||||||
action="store_true",
|
|
||||||
help=(
|
|
||||||
'If set, returns the output of the "timeit" built-in ipython magic'
|
|
||||||
" instead of stdout."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"-p",
|
|
||||||
"--profile",
|
|
||||||
action="store_true",
|
|
||||||
help=(
|
|
||||||
"If set, runs the nvidia nsight compute profiler. Has no effect if"
|
|
||||||
" used with --timeit."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"-a",
|
|
||||||
"--profiler-args",
|
|
||||||
type=str,
|
|
||||||
default="",
|
|
||||||
help=(
|
|
||||||
"Extra options that can be passed to the nvidia nsight compute"
|
|
||||||
" profiler. Must be the last option given to the argument parser"
|
|
||||||
" so you can pass arguments with dashes."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
def get_parser_cuda_group_run() -> argparse.ArgumentParser:
|
def get_parser_cuda_group_run() -> argparse.ArgumentParser:
|
||||||
parser = get_parser_cuda()
|
parser = get_parser_cuda()
|
||||||
parser.description = (
|
parser.description = (
|
||||||
"%%cuda_group_run magic that compiles and runs source files in a"
|
"%%cuda_group_run magic that compiles and runs source files in a given"
|
||||||
" given group."
|
" group. See"
|
||||||
)
|
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-run"
|
||||||
parser.add_argument(
|
" for usage details."
|
||||||
"-g",
|
|
||||||
"--group",
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help="The group whose files should be compiled and executed.",
|
|
||||||
)
|
)
|
||||||
|
parser.add_argument("-g", "--group", type=str, required=True)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@@ -60,49 +32,22 @@ def get_parser_cuda_group_save() -> argparse.ArgumentParser:
|
|||||||
description=(
|
description=(
|
||||||
"%%cuda_group_save magic that saves CUDA C++ code in this cell for"
|
"%%cuda_group_save magic that saves CUDA C++ code in this cell for"
|
||||||
" later compilation and execution with possibly more source files."
|
" later compilation and execution with possibly more source files."
|
||||||
|
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-save"
|
||||||
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument("-n", "--name", type=str, required=True)
|
||||||
"-n",
|
parser.add_argument("-g", "--group", type=str, required=True)
|
||||||
"--name",
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help=(
|
|
||||||
'The name of the saved source file. Must have either the ".cu" or'
|
|
||||||
' ".h" extension. In order to import a header file saved with this'
|
|
||||||
" magic you can simply add '#include \"<name>\"'."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"-g",
|
|
||||||
"--group",
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help=(
|
|
||||||
"The group to which to add the saved source file. Groups are"
|
|
||||||
" source files that get compiled together and do not interact with"
|
|
||||||
" other groups. This allows you to have multiple unrelated CUDA"
|
|
||||||
" programs within the same jupyter notebook. Adding files to a"
|
|
||||||
' group named "shared" will make them available to all other'
|
|
||||||
" source file groups. One use case for this is sharing error"
|
|
||||||
" handling code."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
def get_parser_cuda_group_delete() -> argparse.ArgumentParser:
|
def get_parser_cuda_group_delete() -> argparse.ArgumentParser:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=(
|
description=(
|
||||||
"%%cuda_group_reset magic that deletes all files in a group."
|
"%%cuda_group_delete magic that deletes all files in a group. See"
|
||||||
|
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-delete"
|
||||||
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument("-g", "--group", type=str, required=True)
|
||||||
"-g",
|
|
||||||
"--group",
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help="The group whose files should be deleted.",
|
|
||||||
)
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user