Lesson 2: Udacity Intro to Parallel Programming

Udacity cs344-Introduction to Parallel Programming学习笔记-第一单元 开始学习CUDA编程,跟的是UDACITY的课程,这是他们的课程链接点击打开链接,这里把一些笔记心得记录下来,以作保存。 1、Latency Vs Bandwidth 在这一节讲到了latency,意思是“延迟”,可以简单理解为所花费的时间。 还有Throughput,意思是“吞吐量”,可以简单理解为---人/小时,也即一小时几个人。 这一节的测试,答案为: car:22.5;0.089 阅读详情

lesson 1的一一对应的GPU programming,比如matrix 相乘,从彩色图变成灰阶图。这些都是一一对应的算法。


在这一课,主要讲的是:spencil 以及各种map的parallel programming。


注意,这2个算法的object都是相互独立,没有overlap。在lesson 3以及后续课程将会介绍例如:

reduce, scan, histogram这类算法,其object会有相互重叠之处。


作业就是用的stencil来将filter和图片convolution,从而blur的更加细腻而不是stencil直接去方格的平均数。

结果如下:



source code:

// Homework 2
// Image Blurring
//
// In this homework we are blurring an image. To do this, imagine that we have
// a square array of weight values. For each pixel in the image, imagine that we
// overlay this square array of weights on top of the image such that the center
// of the weight array is aligned with the current pixel. To compute a blurred
// pixel value, we multiply each pair of numbers that line up. In other words, we
// multiply each weight with the pixel underneath it. Finally, we add up all of the
// multiplied numbers and assign that value to our output for the current pixel.
// We repeat this process for all the pixels in the image.

// To help get you started, we have included some useful notes here.

//****************************************************************************

// For a color image that has multiple channels, we suggest separating
// the different color channels so that each color is stored contiguously
// instead of being interleaved. This will simplify your code.

// That is instead of RGBARGBARGBARGBA... we suggest transforming to three
// arrays (as in the previous homework we ignore the alpha channel again):
//  1) RRRRRRRR...
//  2) GGGGGGGG...
//  3) BBBBBBBB...
//
// The original layout is known an Array of Structures (AoS) whereas the
// format we are converting to is known as a Structure of Arrays (SoA).

// As a warm-up, we will ask you to write the kernel that performs this
// separation. You should then write the "meat" of the assignment,
// which is the kernel that performs the actual blur. We provide code that
// re-combines your blurred results for each color channel.

//****************************************************************************

// You must fill in the gaussian_blur kernel to perform the blurring of the
// inputChannel, using the array of weights, and put the result in the outputChannel.

// Here is an example of computing a blur, using a weighted average, for a single
// pixel in a small image.
//
// Array of weights:
//
//  0.0  0.2  0.0
//  0.2  0.2  0.2
//  0.0  0.2  0.0
//
// Image (note that we align the array of weights to the center of the box):
//
//    1  2  5  2  0  3
//       -------
//    3 |2  5  1| 6  0       0.0*2 + 0.2*5 + 0.0*1 +
//      |       |
//    4 |3  6  2| 1  4   ->  0.2*3 + 0.2*6 + 0.2*2 +   ->  3.2
//      |       |
//    0 |4  0  3| 4  2       0.0*4 + 0.2*0 + 0.0*3
//       -------
//    9  6  5  0  3  9
//
//         (1)                         (2)                 (3)
//
// A good starting place is to map each thread to a pixel as you have before.
// Then every thread can perform steps 2 and 3 in the diagram above
// completely independently of one another.

// Note that the array of weights is square, so its height is the same as its width.
// We refer to the array of weights as a filter, and we refer to its width with the
// variable filterWidth.

//****************************************************************************

// Your homework submission will be evaluated based on correctness and speed.
// We test each pixel against a reference solution. If any pixel differs by
// more than some small threshold value, the system will tell you that your
// solution is incorrect, and it will let you try again.

// Once you have gotten that working correctly, then you can think about using
// shared memory and having the threads cooperate to achieve better performance.

//****************************************************************************

// Also note that we've supplied a helpful debugging function called checkCudaErrors.
// You should wrap your allocation and copying statements like we've done in the
// code we're supplying you. Here is an example of the unsafe way to allocate
// memory on the GPU:
//
// cudaMalloc(&d_red, sizeof(unsigned char) * numRows * numCols);
//
// Here is an example of the safe way to do the same thing:
//
// checkCudaErrors(cudaMalloc(&d_red, sizeof(unsigned char) * numRows * numCols));
//
// Writing code the safe way requires slightly more typing, but is very helpful for
// catching mistakes. If you write code the unsafe way and you make a mistake, then
// any subsequent kernels won't compute anything, and it will be hard to figure out
// why. Writing code the safe way will inform you as soon as you make a mistake.

// Finally, remember to free the memory you allocate at the end of the function.

//****************************************************************************

#include "reference_calc.cpp"
#include "utils.h"

__global__
void gaussian_blur(const unsigned char* const inputChannel,
                   unsigned char* const outputChannel,
                   int numRows, int numCols,
                   const float* const filter, const int filterWidth)
{
  // TODO
  
  // NOTE: Be sure to compute any intermediate results in floating point
  // before storing the final result as unsigned char.

  // NOTE: Be careful not to try to access memory that is outside the bounds of
  // the image. You'll want code that performs the following check before accessing
  // GPU memory:
  //
  // if ( absolute_image_position_x >= numCols ||
  //      absolute_image_position_y >= numRows )
  // {
  //     return;
  // }
  
  // NOTE: If a thread's absolute position 2D position is within the image, but some of
  // its neighbors are outside the image, then you will need to be extra careful. Instead
  // of trying to read such a neighbor value from GPU memory (which won't work because
  // the value is out of bounds), you should explicitly clamp the neighbor values you read
  // to be within the bounds of the image. If this is not clear to you, then please refer
  // to sequential reference solution for the exact clamping semantics you should follow.

  /* 
  **    here is the step 1 of this hw
  */
  const int2 thread_2D_pos = make_int2(blockIdx.x * blockDim.x +  threadIdx.x, 
                                     blockIdx.y * blockDim.y + threadIdx.y );

  const int thread_1D_pos = thread_2D_pos.y * numCols + thread_2D_pos.x;

  if(thread_2D_pos.x >= numCols || thread_2D_pos.y >= numRows){
    return;
  }

  int rows = numRows-1;
  int cols = numCols-1;
  int halfwidth = filterWidth/2;
  float blur = 0.0f;

  for (int filter_r = -halfwidth; filter_r <= halfwidth; ++filter_r){
    for (int filter_c = -halfwidth; filter_c <= halfwidth; ++filter_c){
      int i = min(max((thread_2D_pos.y + filter_r),0),rows);
      int j = min(max((thread_2D_pos.x + filter_c),0),cols);
      int idx = i * numCols + j;

      blur += inputChannel[idx] * filter[(filter_r + halfwidth) * filterWidth + 
                        (filter_c + halfwidth)];
    }
  }

  outputChannel[thread_1D_pos] = blur;
  /* 
  **  
  */
}

//This kernel takes in an image represented as a uchar4 and splits
//it into three images consisting of only one color channel each
__global__
void separateChannels(const uchar4* const inputImageRGBA,
                      int numRows,
                      int numCols,
                      unsigned char* const redChannel,
                      unsigned char* const greenChannel,
                      unsigned char* const blueChannel)
{
  // TODO
  //
  // NOTE: Be careful not to try to access memory that is outside the bounds of
  // the image. You'll want code that performs the following check before accessing
  // GPU memory:
  //
  // if ( absolute_image_position_x >= numCols ||
  //      absolute_image_position_y >= numRows )
  // {
  //     return;
  // }

  /* 
  **   here is the step 2 of the hw
  */

  const int2 thread_2D_pos = make_int2(blockIdx.x * blockDim.x + threadIdx.x,
                                      blockIdx.y * blockDim.y + threadIdx.y);
  
  if(thread_2D_pos.x >= numCols || thread_2D_pos.y >= numRows){
    return;    // check if the pixel is out of the boundary
  }

  const int thread_1D_pos = thread_2D_pos.y * numCols + thread_2D_pos.x;
  uchar4 rgba = inputImageRGBA[thread_1D_pos];           //rgba = RGBARGBARGBARGBA...
  redChannel[thread_1D_pos] = rgba.x;
  greenChannel[thread_1D_pos] = rgba.y;
  blueChannel[thread_1D_pos] = rgba.z;

  /* 
  **  
  */
}

//This kernel takes in three color channels and recombines them
//into one image.  The alpha channel is set to 255 to represent
//that this image has no transparency.
__global__
void recombineChannels(const unsigned char* const redChannel,
                       const unsigned char* const greenChannel,
                       const unsigned char* const blueChannel,
                       uchar4* const outputImageRGBA,
                       int numRows,
                       int numCols)
{
  const int2 thread_2D_pos = make_int2( blockIdx.x * blockDim.x + threadIdx.x,
                                        blockIdx.y * blockDim.y + threadIdx.y);

  const int thread_1D_pos = thread_2D_pos.y * numCols + thread_2D_pos.x;

  //make sure we don't try and access memory outside the image
  //by having any threads mapped there return early
  if (thread_2D_pos.x >= numCols || thread_2D_pos.y >= numRows)
    return;

  unsigned char red   = redChannel[thread_1D_pos];
  unsigned char green = greenChannel[thread_1D_pos];
  unsigned char blue  = blueChannel[thread_1D_pos];

  //Alpha should be 255 for no transparency
  uchar4 outputPixel = make_uchar4(red, green, blue, 255);

  outputImageRGBA[thread_1D_pos] = outputPixel;
}

unsigned char *d_red, *d_green, *d_blue;
float         *d_filter;

void allocateMemoryAndCopyToGPU(const size_t numRowsImage, const size_t numColsImage,
                                const float* const h_filter, const size_t filterWidth)
{

  //allocate memory for the three different channels
  //original
  checkCudaErrors(cudaMalloc(&d_red,   sizeof(unsigned char) * numRowsImage * numColsImage));
  checkCudaErrors(cudaMalloc(&d_green, sizeof(unsigned char) * numRowsImage * numColsImage));
  checkCudaErrors(cudaMalloc(&d_blue,  sizeof(unsigned char) * numRowsImage * numColsImage));

  //TODO:
  //Allocate memory for the filter on the GPU
  //Use the pointer d_filter that we have already declared for you
  //You need to allocate memory for the filter with cudaMalloc
  //be sure to use checkCudaErrors like the above examples to
  //be able to tell if anything goes wrong
  //IMPORTANT: Notice that we pass a pointer to a pointer to cudaMalloc

  checkCudaErrors(cudaMalloc(&d_filter, sizeof(float) * filterWidth * filterWidth));
  //TODO:
  //Copy the filter on the host (h_filter) to the memory you just allocated
  //on the GPU.  cudaMemcpy(dst, src, numBytes, cudaMemcpyHostToDevice);
  //Remember to use checkCudaErrors!
  checkCudaErrors(cudaMemcpy(d_filter, h_filter, sizeof(float) * filterWidth * filterWidth, 
                              cudaMemcpyHostToDevice));

}



void your_gaussian_blur(const uchar4 * const h_inputImageRGBA, uchar4 * const d_inputImageRGBA,
                        uchar4* const d_outputImageRGBA, const size_t numRows, const size_t numCols,
                        unsigned char *d_redBlurred, 
                        unsigned char *d_greenBlurred, 
                        unsigned char *d_blueBlurred,
                        const int filterWidth)
{
  //TODO: Set reasonable block size (i.e., number of threads per block)
  const dim3 blockSize(16,16);

  //TODO:
  //Compute correct grid size (i.e., number of blocks per kernel launch)
  //from the image size and and block size.
  const dim3 gridSize((numCols + 15)/16, (numRows + 15)/16);

  //TODO: Launch a kernel for separating the RGBA image into different color channels
  separateChannels<<>>(d_inputImageRGBA,
                      numRows,
                      numCols,
                      d_red,
                      d_green,
                      d_blue);
  // Call cudaDeviceSynchronize(), then call checkCudaErrors() immediately after
  // launching your kernel to make sure that you didn't make any mistakes.
  cudaDeviceSynchronize(); checkCudaErrors(cudaGetLastError());

  //TODO: Call your convolution kernel here 3 times, once for each color channel.
  gaussian_blur<<>>(
                   d_red,
                   d_redBlurred,
                   numRows, numCols,
                   d_filter, filterWidth);
    gaussian_blur<<>>(
                   d_green,
                   d_greenBlurred,
                   numRows, numCols,
                   d_filter, filterWidth);
      gaussian_blur<<>>(
                   d_blue,
                   d_blueBlurred,
                   numRows, numCols,
                   d_filter, filterWidth);

  // Again, call cudaDeviceSynchronize(), then call checkCudaErrors() immediately after
  // launching your kernel to make sure that you didn't make any mistakes.
  cudaDeviceSynchronize(); checkCudaErrors(cudaGetLastError());

  // Now we recombine your results. We take care of launching this kernel for you.
  //
  // NOTE: This kernel launch depends on the gridSize and blockSize variables,
  // which you must set yourself.
  recombineChannels<<>>(d_redBlurred,
                                             d_greenBlurred,
                                             d_blueBlurred,
                                             d_outputImageRGBA,
                                             numRows,
                                             numCols);
  cudaDeviceSynchronize(); checkCudaErrors(cudaGetLastError());
}


//Free all the memory that we allocated
//TODO: make sure you free any arrays that you allocated
void cleanup() {
  checkCudaErrors(cudaFree(d_red));
  checkCudaErrors(cudaFree(d_green));
  checkCudaErrors(cudaFree(d_blue));
}

csdn的snippet怎么总是502 bad gateway???、

Udacity cs344-Introduction to Parallel Programming学习笔记-第三单元 1、第一个quiz答案:6,21,问题很简单,数一下就好了。 2、什么是“归约”操作 归约操作有两个输入: 1)输入对象的集合 2)归约运算符:满足二元操作符、满足可结合性 3、第二个quiz答案:multiply、minimum、logical or、bitwise and 4、第三个quiz答案:2、3选项是对的。 5、第四个quiz答案:(a+b 阅读详情

相关推荐

Udacity cs344Unit 1-Introduction to Parallel Programming笔记(超详细,CUDA,并行,GPU

0.课程简介:要学并行思维,是最重要的,当在别的领域遇到瓶颈时,并行思维也许能帮上忙 课程链接:点我 Unit 1 1.举例,怎么能更快的从美国挖洞到中国 解决方案 a.用一个铲子,从每2秒挖一下,变成每1秒挖一下,有上限,太快铲子会断 (提高处理器的时钟频率,会增加能耗,每个芯片能耗都有上限) b.用有两个铲子头的铲子,但是有工艺的限制,不能有100个铲子头 (每个时钟周期进行更...

Ria_Ria的博客 1856

Intro to Parallel Programming CUDA-第二单元

一、parallel communication patterns   并行通信模式 Map:映射,在特定的位置读取和写入。 Gather:收集,从多个不同的位置读入,写入一个位置。 Scatter:分发,写入多个位置。 Transpose转置 结构数组缩写为AOS,数组结构缩写为SOA 转置运算是指任务重新排序内存中的数据元素 Stencil模板 能够在输出结果为每一个元素生...

AplusX 551

Udacity cs344-Introduction to Parallel Programming学习笔记-如何在VS环境下编译课程习题代码

Udacity的这个CUDA课程非常不错,提供了一个在线的编辑、编译、运行平台,我们可以直接在web上完成代码编辑、提交、查看运行结果,但是,有时候,面对比较复杂的问题,我们还是希望能够有一个本地的环境来执行这些代码,并且实现debug,调试代码,所以这篇博客主要是介绍如何在Visual Studio环境下完成代码的编译执行过程。 下面以第一单元的彩色图转灰度图为例子来讲解,我这里是VS

suda的博客 2393

【走进CUDA】~详解CUDA核函数及运行时参数

详解CUDA核函数及运行时参数。

Running Jonny 7467

Intro to Algorithm

算法导论入门,里面包括了一些常用算法和高级算法的讲解

STM32开发工具链选型:MDK、CubeIDE、VSCode与IAR深度对比

嵌入式开发工具链是连接软件逻辑与硬件行为的核心枢纽,其选择直接影响代码可靠性、调试效率与量产稳定性。从编译器优化能力、调试协议支持(如ARM CoreSight、SWO)、硬件抽象层级(寄存器/LL/HAL)到跨平台构建能力,不同工具在实时性保障、静态分析合规性(如MISRA-C)、WCET可预测性及生态开放度上存在本质差异。尤其在STM32平台,Keil MDK凭借深度调试能力成为HardFault定位首选,STM32CubeIDE依托图形化配置加速外设初始化,而VSCode+PlatformIO则以LS

weixin_42602368的博客 431

The quiz 1 of Intro to Parallel Program

Homework 1 Color to Greyscale Conversion   A common way to represent color images isknown as RGBA - the color is specified by how much Red, Green, and Blue is init. The 'A' stands for Alpha and is

Duke__Lee的博客 517

华为2022硬件逻辑笔试题

单选题(每题两分) 1.以下关于过程赋值的描述,不正确的是() A在非阻塞性过程赋值中,使用赋值符号“< =” B赋值操作符是“=”的过程赋值是阻塞性过程赋值 C在非阻塞性过程赋值中,对目标的赋值是非阻塞的(因为时延),但可预定在将来某个时间步发生(根据时延:如果是0时延,那么在当前时间步结束) D非阻塞性过程赋值在其后所有语句执行前执行 解:D 2.芯片的功耗和下列哪种不强相关_____________。 A资源利用率 B核电压 C组合逻辑级数 D翻转率 解:A 3.下列说

weixin_44072819的博客 1万+

Lesson1: Udacity parallel programming 学习笔记

In this lesson, we learned the 4 partitions of CUDA program and how to utilize the block, thread for parallel programming in GPU. 1.      CUDA Malloc; 2.      CUDA Memcpy; from host to device 3.

纯黑老白的专栏 1250

使用项目管理画布启动项目

许多人对商业模式画布并不陌生,它是亚历山大·奥斯特瓦德(Alexander Osterwalder)、伊夫·皮尼厄(Yves Pigneur)在《商业模式新生代》(Business Model Generation)中提出的一种用来描述商业模式、可视化商业模式、评估商业模式以及改变商业模式的通用语言。 在我们做敏捷软件项目inception(项目启动规划)的时候经常会用到商业画布,此时它的作用是帮助我们快速了解客户的业务、产品和市场,帮助客户梳理自己的资源、优势和盈利模式,总的来说,商业画布是一种简单实用的

IDEAL Garden 1224

GPOPSII 对控制量变化率进行约束,避免控制量振荡

在这篇文章中,在GPOPSII中通过对控制量变化的约束,优化求解得到更平滑的控制量曲线,更符合真实控制约束。

Dannyfomer的博客 1871

Udacity cs344Unit 2-Introduction to Parallel Programming笔记(超详细,CUDA,并行,GPU)

1.通信   2.通信的不同类型以及并行计算中,不同的通信模型(about how to map tasks(which are threads in cuda) and meory together) 通信的模式叫做映射(communication pattern is called map) 有在黄格子里的每个元素,你将对每个元素进行同样的函数或者计算任务 这是一个线...

Ria_Ria的博客 1120

【AI测试必学】DeepSeek API 快速入门:获取 API Key 与调用 API 步骤详解

DeepSeek API 使用与 OpenAI 兼容的格式,可以通过修改配置使用 OpenAI SDK。生成的 API Key 只会显示一次,请妥善保存。注册并登录账号,进入左侧导航栏的。创建 API Key。

blues_C的博客 1万+

Udacity cs344-Introduction to Parallel Programming学习笔记-第二单元

1、parallel communication patterns   并行通信模式 Map:映射,在特定的位置读取和写入。 Gather:收集,从多个不同的位置读入,写入一个位置。 Scatter:分发,写入多个位置。 第一个quiz答案:Scatter 有点费解,一开始我以为是Map,后来有人提出一个这样的理解,貌似能说的通。先附在下方,留待日后回过头来理解。 MA

suda的博客 2673

视觉Transformer实战 | Transformer详解与实现

本文系统介绍了 Transformer 架构的核心原理与实现。相比传统 RNN 和 CNN,Transformer 凭借自注意力机制有效捕捉序列中的长距离依赖关系,支持并行训练,显著提升效率。其核心创新在于通过查询、键、值向量计算注意力权重,理解单词间的语义关联。架构包含编码器-解码器结构:编码器通过多头自注意力和前馈网络提取输入特征;解码器利用掩码自注意力和交叉注意力生成输出。本文使用 PyTorch 实现了缩放点积注意力、位置编码、层归一化等关键模块,并构建了完整的 Transformer 模型。

盼小辉丶的博客 4万+

ArcGIS与地理加权回归GWR【一】

因此,在实际问题研究中我们经常发现回归参数在不同地理位置上往往表现为不同,也就是说回归参数随地理位置变化,这时如果仍然采用全局空间回归模型(全局假设β是不会变得),得到的回归参数估计将是回归参数在整个研究区域内的平均值,如上所说某一个因素在ABC等不同的地理位置对房价的影响是不同的,假如采用全局空间回归模型,便忽略了数据的空间位置属性,只反映平均意义下因变量与自变量的相关关系,而不能有效反映回归关系的空间非平稳性的特征。当自变量为1个时,是一元线性回归,自变量为2个及以上时,称为多元线性回归。

JData_Engineer的博客 1377

cuda编程(4):常见的例程

一、直方图 #include <cuda_runtime.h> #include <device_launch_parameters.h> #include <stdio.h> int log2(int i) { int r = 0; while (i >>= 1) r++; return r; } int bit_reverse(int w, int bits) { int r = 0; for (int i = 0; i < bit

SeventhBlue 1221

芒果YOLOv12改进13:独家原创改进最新 CFNet 核心结构|即插即用 | 首发改进显著提升检测性能,小目标检测涨点必备

芒果YOLOv12改进13:独家原创改进最新 CFNet 核心结构|即插即用 | 首发改进显著提升检测性能,小目标检测涨点必备

包括YOLOv5、YOLOv7、YOLOv8等模型改进 289

Udacity cs344Unit 5-Introduction to Parallel Programming笔记(超详细,CUDA,并行,GPU)

1.优化的等级 2.应该有一个系统化的优化过程(类似于一个优化的周期,缺少哪一步效果都不好) 在真实数据集上跑很重要 不要“真空”优化 别忘了 思考你到底想实现啥 和在现实世界中执行收到反馈 3.具体过程 a.分析 4.强缩放和弱缩放 ...

Ria_Ria的博客 687

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Udacity cs344Unit 4-Introduction to Parallel Programming笔记(超详细,CUDA,并行,GPU)

1.啥是紧密(compact):这里的压缩指的是过滤,filter,过滤出一个子集,也就是只留我们想要的(比如一把扑克牌里的方片) (只计算我们关心的对象才更有意义,计算代价较小,需要更少空间) 2. 3.密集运算好一点?为啥 第一个稀疏运算要启动52个线程,而其中39个线程都是空的(线程成本较高) 第二个虽然过滤出方片会有成本,但是在接下来的映射步骤中它只启动13个...

Ria_Ria的博客 635

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

CS344 Udacity 答案

这里我只给出student.cu的代码 Ploblem Set1// Homework 1 // Color to Greyscale Conversion //A common way to represent color images is known as RGBA - the color //is specified by how much Red, Green, and Blue i

B10090411的博客 2017

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Parallel Programming with CUDA

from:https://avisingh599.github.io/gpu/parallel-programming-with-cuda/ I recently started going through an amazing Udacity course on Parallel Programming. Having been working on image processing

Kelvin_Yan的专栏 1101

SSE图像算法优化系列二:高斯模糊算法的全面优化过程分享(一)。

     这里的高斯模糊采用的是论文《Recursive implementation of the Gaussian filter》里描述的递归算法。                      仔细观察和理解上述公式,在forward过程中,n是递增的,因此,如果在进行forward之前,把in数据先完整的赋值给w,然后式子(9a)就可以变为:       w[n] = B w[n] + ...

weixin_34273481的博客 680

Udacity cs344Unit 3-Introduction to Parallel Programming笔记(超详细,CUDA,并行,GPU)

1.课程目标 如何分析GPU算法的速度和效率(speed and efficiency) 三个新的基本算法:归约,扫描和直方图(reduce,scan and histogram) 2.   3.再看之前讲的例子 考虑两件事   介绍几个概念 a.步骤(step):指的是 单人!完成某特定计算(比如挖洞)所需时间 b.工作总量(total amount of wor...

Ria_Ria的博客 1067

从Nachos转向ucore/xv6

今天和课程图谱的PKU大牛聊了下。对于学习OS,他推荐MIT的xv6,因为相对于UCB的NACHOS,它更加全面而且麻雀虽小五脏俱全。加上参考资料更多,而且是用C写的,所以更好的做lab,有自动批改的script。MIT 6.828 operating system 然后又发现清华在xv6的基础上,做了个ucore,增加了可读性,且增加了个更多是lab可以一步一步的学习。很赞。一个PPT的介绍 

纯黑老白的专栏 3603

UCB CS162:operating system In Java with NACHOS Lesson 1

先把nachos在virtualbox里面跑起来才行。 虽然已经有了mips compiler,但是java jdk没装。可以按照这个链接做:点击打开链接 如果什么都没有改动的话,直接make然后nachos,会出来这样就是对的。 现在既然environment搭建好了,就可以开始做实验了。 当然,正如开头所说,这节课用的Nachos是用java写的,因为原版的用C写,很容

纯黑老白的专栏 2257
上一篇: UCB CS162:operating system In Java with NACHOS Lesson 1
下一篇: liuru jia ACM训练指南链接(转载自BearChild blog)
纯黑老白
博客等级 码龄18年 30粉丝 62原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值